public ActionResult DeletePost(int id)
        {
            var Item = _repository.GetPostIdAsync(id);

            if (Item == null)
            {
                return(NotFound());
            }

            _repository.DeletePostAsync(Item);
            _repository.SaveChanges();

            return(NoContent());
        }
Exemple #2
0
 public async Task <Post> DeletePostAsync(PostDto postDto)
 {
     return(await _context.DeletePostAsync(postDto));
 }