public async Task <ActionResult> Index() { var model = new PostsViewModel { Posts = await _postService.GetAsync(string.Empty, false), PostCategories = await _postCategoryService.GetAsync() }; return(View(model)); }
public async Task <ActionResult> Edit(int postCategoryId) { var postCategory = await _postCategoryService.GetAsync(postCategoryId); var model = new EditViewModel { PostCategoryId = postCategoryId, PostCategoryName = postCategory.PostCategoryName }; return(View("_Edit", model)); }