Beispiel #1
0
 public DoctorDto GetDoctor(Guid nodeGuid)
 {
     return(DocumentQueryService.GetDocument <CMS.DocumentEngine.Types.MedioClinic.Doctor>(nodeGuid)
            .AddColumns(_doctorColumns)
            .Select(DoctorDtoSelect)
            .FirstOrDefault());
 }
 public SchoolDto GetSchool(Guid nodeGuid)
 {
     return(DocumentQueryService.GetDocument <CMS.DocumentEngine.Types.MedioClinic.School>(nodeGuid)
            .AddColumns(_schoolColumns)
            .Select(SchoolDtoSelect)
            .FirstOrDefault());
 }
Beispiel #3
0
 public ArticleDto GetArticle(Guid nodeGuid)
 {
     return(DocumentQueryService.GetDocument <CMS.DocumentEngine.Types.MedioClinic.Article>(nodeGuid)
            .AddColumns(_articleColumns)
            .Select(ArticleDtoSelect)
            .FirstOrDefault());
 }
Beispiel #4
0
        public TLandingPageDto GetLandingPage <TKenticoLandingPage, TLandingPageDto>
            (string pageAlias,
            Func <DocumentQuery <TKenticoLandingPage>, DocumentQuery <TKenticoLandingPage> > queryModifier = null,
            Func <TKenticoLandingPage, TLandingPageDto, TLandingPageDto> selector = null)
            where TKenticoLandingPage : TreeNode, new()
            where TLandingPageDto : LandingPageDto, new()
        {
            var query = DocumentQueryService.GetDocument <TKenticoLandingPage>(pageAlias)
                        .AddColumns("DocumentID", "DocumentName");

            if (queryModifier != null)
            {
                query = queryModifier(query);
            }

            Func <TKenticoLandingPage, TLandingPageDto> completeSelector = (landingPage) =>
            {
                var dto = new TLandingPageDto
                {
                    DocumentId = landingPage.DocumentID,
                    Title      = landingPage.DocumentName
                };

                return(selector != null?selector(query, dto) : dto);
            };

            return(query
                   .Select(completeSelector)
                   .FirstOrDefault());
        }
Beispiel #5
0
 public LandingPageDto GetLandingPageDto(string pageAlias)
 {
     return(DocumentQueryService.GetDocument <CMS.DocumentEngine.Types.MedioClinic.LandingPage>(pageAlias)
            .AddColumns("DocumentID", "DocumentName")
            .ToList()
            .Select(lp => Mapper.Map <LandingPageDto>(lp))
            .FirstOrDefault());
 }
 public LandingPageDto GetLandingPage(string pageAlias)
 {
     return(DocumentQueryService.GetDocument <CMS.DocumentEngine.Types.MedioClinic.LandingPage>(pageAlias)
            .AddColumns("DocumentID", "DocumentName")
            .ToList()
            .Select(landingPage => new LandingPageDto()
     {
         DocumentId = landingPage.DocumentID,
         Title = landingPage.DocumentName
     })
            .FirstOrDefault());
 }