public SchoolDto GetSchool(Guid nodeGuid) { return(DocumentQueryService.GetDocument <CMS.DocumentEngine.Types.MedioClinic.School>(nodeGuid) .AddColumns(_schoolColumns) .Select(SchoolDtoSelect) .FirstOrDefault()); }
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()); }
public IEnumerable <DoctorDto> GetDoctors() { return(DocumentQueryService.GetDocuments <CMS.DocumentEngine.Types.MedioClinic.Doctor>() .AddColumns(_doctorColumns) .ToList() .Select(DoctorDtoSelect)); }
public ArticleDto GetArticle(Guid nodeGuid) { return(DocumentQueryService.GetDocument <CMS.DocumentEngine.Types.MedioClinic.Article>(nodeGuid) .AddColumns(_articleColumns) .Select(ArticleDtoSelect) .FirstOrDefault()); }
public IEnumerable <SchoolDto> GetSchools() { return(DocumentQueryService.GetDocuments <CMS.DocumentEngine.Types.MedioClinic.School>() .AddColumns(_schoolColumns) .ToList() .Select(SchoolDtoSelect)); }
public DoctorDto GetDoctor(Guid nodeGuid) { return(DocumentQueryService.GetDocument <CMS.DocumentEngine.Types.MedioClinic.Doctor>(nodeGuid) .AddColumns(_doctorColumns) .Select(DoctorDtoSelect) .FirstOrDefault()); }
public IEnumerable <CompanyServiceDto> GetCompanyServices() { return(DocumentQueryService.GetDocuments <CMS.DocumentEngine.Types.MedioClinic.CompanyService>() .AddColumns("Header", "Text", "Icon") .OrderByAscending("NodeOrder") .ToList() .Select(m => Mapper.Map <CompanyServiceDto>(m))); }
public IEnumerable <ArticleDto> GetArticles() { return(DocumentQueryService.GetDocuments <CMS.DocumentEngine.Types.MedioClinic.Article>() .AddColumns(_articleColumns) .ToList() .Select(ArticleDtoSelect) .OrderByDescending(obj => obj.DatePublished)); }
public IEnumerable <SocialLinkDto> GetSocialLinks() { return(DocumentQueryService.GetDocuments <SocialLink>() .AddColumns("Title", "Url", "Icon") .OrderByAscending("NodeOrder") .ToList() .Select(socialLink => Mapper.Map <SocialLinkDto>(socialLink))); }
public IEnumerable <MapLocationDto> GetOfficeLocations() { return(DocumentQueryService.GetDocuments <MapLocation>() .AddColumns("Longitude", "Latitude", "Tooltip") .OrderByAscending("NodeOrder") .ToList() .Select(mld => Mapper.Map <MapLocationDto>(mld))); }
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 ContactSectionDto GetContactSection() { return(DocumentQueryService.GetDocuments <ContactSection>() .TopN(1) .AddColumns("Title", "Subtitle", "Text") .ToList() .Select(cs => Mapper.Map <ContactSectionDto>(cs)) .FirstOrDefault()); }
public IEnumerable <MenuItemDto> GetMenuItems() { return(DocumentQueryService.GetDocuments <MenuContainerItem>() .Path("/Menu-items", PathTypeEnum.Children) .AddColumns("Controller", "Action", "Caption") .OrderByAscending("NodeOrder") .ToList() .Select(mi => Mapper.Map <MenuItemDto>(mi))); }
public HomeSectionDto GetHomeSection() { return(DocumentQueryService.GetDocuments <HomeSection>() .AddColumns("Title", "Text", "Button") .TopN(1) .ToList() .Select(m => Mapper.Map <HomeSectionDto>(m)) .FirstOrDefault()); }
public DoctorSectionDto GetDoctorSection() { return(DocumentQueryService.GetDocuments <DoctorSection>() .AddColumns("Title") .TopN(1) .Select(m => new DoctorSectionDto() { Header = m.Title }) .FirstOrDefault()); }
public IEnumerable <MapLocationDto> GetOfficeLocations() { return(DocumentQueryService.GetDocuments <CMS.DocumentEngine.Types.MedioClinic.MapLocation>() .AddColumns("Longitude", "Latitude", "Tooltip") .OrderByAscending("NodeOrder") .Select(m => new MapLocationDto() { Latitude = m.Latitude, Longitude = m.Longitude, Tooltip = m.Tooltip })); }
public IEnumerable <SocialLinkDto> GetSocialLinks() { return(DocumentQueryService.GetDocuments <CMS.DocumentEngine.Types.MedioClinic.SocialLink>() .AddColumns("Title", "Url", "Icon") .OrderByAscending("NodeOrder") .Select(m => new SocialLinkDto() { Url = m.Url, Title = m.Title, Icon = m.Fields.Icon })); }
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()); }
public IEnumerable <CompanyServiceDto> GetCompanyServices() { return(DocumentQueryService.GetDocuments <CMS.DocumentEngine.Types.MedioClinic.CompanyService>() .AddColumns("Header", "Text", "Icon") .OrderByAscending("NodeOrder") .Select(m => new CompanyServiceDto() { Header = m.Header, Text = m.Text, Icon = m.Fields.Icon })); }
public IEnumerable <MenuItemDto> GetMenuItems() { return(DocumentQueryService.GetDocuments <MenuContainerItem>() .Path("/Menu-items", PathTypeEnum.Children) .AddColumns("Caption", "Controller", "Action") .OrderByAscending("NodeOrder") .Select(m => new MenuItemDto() { Action = m.Action, Caption = m.Caption, Controller = m.Controller })); }
public ContactSectionDto GetContactSection() { return(DocumentQueryService.GetDocuments <ContactSection>() .TopN(1) .AddColumns("Title", "Subtitle", "Text") .Select(m => new ContactSectionDto() { Header = m.Title, Subheader = m.Subtitle, Text = m.Text, }) .FirstOrDefault()); }
public HomeSectionDto GetHomeSection() { return(DocumentQueryService.GetDocuments <HomeSection>() .AddColumns("Title", "Text", "Button") .TopN(1) .Select(m => new HomeSectionDto() { Title = m.Title, Text = m.Text, LinkText = m.Button }) .FirstOrDefault()); }
protected void Application_Start() { AreaRegistration.RegisterAllAreas(); GlobalConfiguration.Configure(WebApiConfig.Register); FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); RouteConfig.RegisterRoutes(RouteTable.Routes); BundleConfig.RegisterBundles(BundleTable.Bundles); // WebApiConfig.Register(GlobalConfiguration.Configuration); // Configure the MVC view Engine as the core one System.Web.Mvc.ViewEngines.Engines.Clear(); System.Web.Mvc.ViewEngines.Engines.Add(new MulitTenantRazorViewEngine()); var documentService = new DocumentQueryService <Tenant>(); TenantService.Tenants = documentService.GetAll(); }
public CompanyDto GetCompany() { return(DocumentQueryService.GetDocuments <CMS.DocumentEngine.Types.MedioClinic.Company>() .AddColumns("CompanyName", "Street", "City", "Country", "ZipCode", "PhoneNumber", "Email") .TopN(1) .ToList() .Select(company => { var mapped = Mapper.Map <CompanyDto>(company); var(country, state) = GetCountryStateFromCompany(company); mapped.Country = country; mapped.State = state; return mapped; }).FirstOrDefault()); }
protected virtual T GetById <T>(string id) where T : SerializableResource { try { var service = new DocumentQueryService <T>(); return(service.GetById(id)); } catch (HttpResponseException ex) { ElmahLogger.LogError(ex); throw; } catch (Exception ex) { ElmahLogger.LogError(ex); throw new HttpResponseException(HttpStatusCode.InternalServerError); } }
public CompanyDto GetCompany() { return(DocumentQueryService.GetDocuments <CMS.DocumentEngine.Types.MedioClinic.Company>() .AddColumns("CompanyName", "Street", "City", "Country", "ZipCode", "PhoneNumber", "Email") .TopN(1) .ToList() .Select(m => { var splitCountry = m.Country.Split(';'); string country; string state = null; if (splitCountry.Length == 2) { country = splitCountry[0]; state = splitCountry[1]; } else { country = m.Country; } return new CompanyDto() { Name = m.CompanyName, City = m.City, Street = m.Street, Country = country, State = state, Email = m.Email, PhoneNumber = m.PhoneNumber, ZipCode = m.ZipCode }; }) .FirstOrDefault()); }
public GetSiteConfigurationQueryHandler(IMapper mapper, DocumentQueryService documentQueryService) { this.mapper = mapper; this.documentQueryService = documentQueryService; }
public GetHomePageQueryHandler(IMapper mapper, DocumentQueryService documentQueryService) { this.mapper = mapper; this.documentQueryService = documentQueryService; }
// GET: Tenant public ActionResult Index() { var model = DocumentQueryService.GetAll(); return(View(model)); }