Source

main / Source / WebService / Web.Admin / DataContext / RepositoryDataContext.cs

Full commit
Naethra D ba1cb57 































using System.Collections.Generic;
using System.Linq;
using Model = DataUp.Web.Service.Model;

namespace DataUp.Web.Admin
{
    public partial class RepositoryDataContext
    {
        internal static List<Model.RepositoryDetail> repositoryDetails = new List<Model.RepositoryDetail>();
        static DataLayer.IRepositoryDetailsDB _repositoryDetailsDB;

        public RepositoryDataContext()
        {
            _repositoryDetailsDB = new DataLayer.RepositoryDetailsDB(new DataLayer.DCXLAdminEntities());
            repositoryDetails = (from val in _repositoryDetailsDB.GetRespositories().ToList()
                                 select new Model.RepositoryDetail
                                 {
                                     RepositoryName = val.RepositoryName,
                                     RepositoryId = val.Id,
                                     IdentifierLink = val.GetIdentifierUrl,
                                     PostFileLink = val.PostFileUrl,
                                     Type = val.RepositoryType.RepositoryType1,
                                     IsPasswordRequired = val.RepositoryType.PasswordRequired.HasValue ? val.RepositoryType.PasswordRequired.Value : false
                                 }).ToList();

        }

        public IQueryable<Model.RepositoryDetail> Repositories
        {
            get { return repositoryDetails.AsQueryable<Model.RepositoryDetail>(); }
        }
    }
}