public async Task <IActionResult> Add([FromBody] Article article) { if (article == null) { return(BadRequest($"{nameof(article)} cannot be null")); } string msg = string.Empty; if (!ModelState.IsValid) { return(BadRequest("Complete and correct all required fields and try again!")); } if (ModelState.IsValid) { var result = await _dataStore.AddArticleAsync(article); msg = result.Message; if (result.Succeeded) { var json = new JsonResponse { Json = result.Article, Message = msg }; return(Ok(json)); } } return(BadRequest(msg)); }