public IActionResult Update(UpdateBlogViewModel vm) { if (!ModelState.IsValid) { return(BadRequest("Invalid model")); } var blog = _blogService.Update(vm.ToModel()); return(Ok(BlogViewModel.From(blog))); }
public IActionResult Details(int id) { var result = _blogService.GetBlog(id); return(Ok(BlogViewModel.From(result))); }