public async Task <PageConfigurationObject> GetPageConfigurationObject(int id) { var page = await _pageRepository.GetAsync(id); var pageContents = await _contentRepository.GetAllListAsync(a => a.Page.Id == id); if (!pageContents.Any()) { return(await CreateEmptyPageConfigurationObject(page)); } return(new PageConfigurationObject() { PageName = page.Name, IsActive = page.Active, Id = id, ContentsByLanguage = await GetContentsByLanguage(pageContents), IsMainPage = page.IsMainPage, CategoryName = page.CategoryId.HasValue ? GetCategoryName(page) : "", IncludeInMenu = page.IncludeInMenu, TemplateName = page.TemplateName, ShowBreadCrum = page.ShowBreadCrum, BreadCrumInContainer = page.BreadCrumInContainer, AvailableTemplates = await _templateManager.GetTemplateContentsAsync(), AvailablePages = (await GetPageListDto()).Where(a => a.Id != page.Id).ToList(), ParentId = page.ParentPage ?? 0, AvailableCategoryDtos = _categoryRepository.GetAllList().Select(a => new CategoryDto() { DisplayName = a.DisplayName, Id = a.Id, Name = a.Name }).ToList(), CategoryId = page.CategoryId ?? 0 }); }
public async Task <ReturnModel <TemplateInfo> > GetTemplatesTable(RequestModel <object> request) { var templates = await _templateManager.GetTemplateContentsAsync(); return(new ReturnModel <TemplateInfo>() { data = templates.ToArray() }); }