public async Task <ActionResult> ListCategorys(string routePath, int pageIndex) { var category = await _categoryService.Get(routePath); if (category == null) { return(HttpNotFound()); } return(List(pageIndex, _postService.GetListByCategory(routePath), new SeoModelFull { Description = category.Seo.Description, Keywords = category.Seo.Keywords, Title = category.Title })); }
public IQueryable <PostRecord> GetListByCategory(string categoryRoutePath) { var category = _categoryService.Get(categoryRoutePath).Result; return(category == null ? null : DefaultTable().Where(i => i.Categorys.Any(z => z.Id == category.Id))); }