public async Task OnGet(Guid pid, int skipCount = 0, int pageSize = 20) { var category = await contentBusiness.GetCategoryById(pid); CategoryName = category?.Category?.Name; var result = await contentBusiness.GetContentListByCategoryId(pid); ContentEntryList = result.OrderBy(x => x.Order).ToList(); }
public async Task <IActionResult> AddOrUpdate(Guid?Id) { ViewData["DataType"] = typeof(Categories); if (Id != null) { var contentEntry = await contentBusiness.GetCategoryById(Id.Value); ViewData["DataModel"] = contentEntry; } return(View()); }
public async Task <IActionResult> GetCategoryByCateId(Guid cid) { var userIdStr = User.Claims.FirstOrDefault(x => x.Type == "OryxUser")?.Value; ApiMessage apiMsg; if (string.IsNullOrEmpty(userIdStr)) { apiMsg = await ApiMessage.Wrap(async() => { return(await contentBusiness.GetCategoryById(cid)); }); } else { var userId = Guid.Parse(userIdStr); apiMsg = await ApiMessage.Wrap(async() => { return(await contentBusiness.GetCategoryByIdWithUserReadLog(cid, userId)); }); } return(Json(apiMsg)); }