public async Task <IActionResult> Create(Post post) { try { await _postBusiness.CreatePost(post); return(Ok()); } catch (ArgumentException e) { return(BadRequest(e.Message)); } }
public IActionResult Maintenance(Posts entity) { entity.Publish_Date = DateTime.Now; if (entity.Id > 0) { _postBusiness.UpdatePost(entity); } else { _postBusiness.CreatePost(entity); } return(RedirectToAction("Post")); }