public async Task <IActionResult> Put(int id, PostDto postDto) { var post = _mapper.Map <Post>(postDto); post.Id = id; var result = await _postBusiness.UpdatePost(post); var response = new ApiResponse <bool>(result); return(Ok(response)); }
public IActionResult Maintenance(Posts entity) { entity.Publish_Date = DateTime.Now; if (entity.Id > 0) { _postBusiness.UpdatePost(entity); } else { _postBusiness.CreatePost(entity); } return(RedirectToAction("Post")); }