public async Task <IActionResult> Edit(int?id, [FromServices] ICategoryServices categoryServices) { if (id == null) { return(NotFound()); } var post = await postServices.Get(id.Value); if (post == null) { return(NotFound()); } CreatePostViewModel createPostViewModel = await ConfigureCreatePostViewModel(categoryServices, post, null); return(View(createPostViewModel)); }
public async Task <IList <PostDto> > GetPostsAsync() { return(await _postServices.Get()); }
public async Task <PostDto> GetPostAsync(string postId) { var result = ValidateId(postId); return(await _postServices.Get(result)); }