public Task <bool> CreatePost(string username, string text) { return(Task.FromResult(_blogManager.AddPost(new CreatePostRequest { Text = text, UserName = username }))); }
public bool Post([FromBody] CreatePostRequest request) { if (ModelState.IsValid) { try { return(_blogManager.AddPost(request)); } catch (Exception ex) { _logger.LogError(ex, $"Error creating post.", null); } } return(false); }