public bool Put([FromBody] UpdatePostRequest request) { if (ModelState.IsValid) { try { return(_blogManager.EditPost(request)); } catch (Exception ex) { _logger.LogError(ex, $"Error editing post.", null); } } return(false); }
public Task <bool> UpdatePost(PostDTO post) { return(Task.FromResult(_blogManager.EditPost(new UpdatePostRequest { PostId = post.Id, Text = post.Text }))); }