public async Task <IActionResult> Detail(int id, DetailTypeSSOT DetailType) { var Content = await _contentManagementService.Find(id); var Gallery = _GalleryService.GetGalleries(id); if (Content.SubMenuId.HasValue) { var menu = await _MenuRepository.Find(Content.SubMenuId.Value); TempData["DetailType"] = menu.DetailType; } //if (DetailType == DetailTypeSSOT.Blog) //{ // return View("~/Views/Home/Detail.cshtml", new Tuple<ContentEntity, List<Tochal.Core.DomainModels.Entity.Content.Gallery>>(Content, Gallery)); //} if (DetailType == DetailTypeSSOT.Pro) { return(View("~/Views/Home/PostDetail.cshtml", new Tuple <ContentEntity, List <Tochal.Core.DomainModels.Entity.Content.Gallery> >(Content, Gallery))); } else { return(View("~/Views/Home/Text.cshtml", new Tuple <ContentEntity, List <Tochal.Core.DomainModels.Entity.Content.Gallery> >(Content, Gallery))); } }
protected async override Task OnInitializedAsync() { // return base.OnInitializedAsync(); _galleryService = (GalleryService)ScopedServices.GetService(typeof(GalleryService)); Items = await _galleryService.GetGalleries(true).ToListAsync(); }
public async Task <IActionResult> Edit(int id) { var model = await _ContentManagementRepository.GetByCondition <ContentEntityDTO>(p => p.Id == id); var Gallery = _GalleryService.GetGalleries(id); return(View(new Tuple <ContentEntityDTO, List <Core.DomainModels.Entity.Content.Gallery> >(model, Gallery))); }
public override async Task PreRender() { Galleries = await galleryService.GetGalleries(); await base.PreRender(); }