public ActionResult DeletePost(int id) { var Item = _repository.GetPostIdAsync(id); if (Item == null) { return(NotFound()); } _repository.DeletePostAsync(Item); _repository.SaveChanges(); return(NoContent()); }
public async Task <Post> DeletePostAsync(PostDto postDto) { return(await _context.DeletePostAsync(postDto)); }