public ActionResult GetCategoriesWithEdit(Guid id) { CategoryWithEditVM result = _categoryLogic.GetCategoriesWithEditAsync(id); ReqFilterCategory reqFilterCategory = new ReqFilterCategory { PageSize = 5, CurrentPage = 1 }; var result2 = _categoryLogic.FilterCategoryWithPagingAsync(reqFilterCategory); result.CategoryList = result2.Result; return(Ok(new BaseResponse(result))); }
/* * Get list all category with edit data */ public CategoryWithEditVM GetCategoriesWithEditAsync(Guid id) { CategoryWithEditVM categoryWithEditVM = new CategoryWithEditVM(); try { // categoryWithEditVM.CategoryList = _uow.GetRepository<Category>().GetAll(); Category categoryData = _uow.GetRepository <Category>().GetWithRelated(a => a.Id == id, null, "Seo").FirstOrDefault(); if (categoryData != null) { categoryWithEditVM.Category = categoryData; } return(categoryWithEditVM); } catch (Exception ex) { Logger.LogError(ex.Message.ToString()); throw ex; } }