Beispiel #1
0
        public User Delete(int id)
        {
            User deletedUser = GetUserFromId(id);

            userContext.Remove(GetUserFromId(id));
            userContext.SaveChanges();

            return(deletedUser);
        }
Beispiel #2
0
        public Post Delete(int id)
        {
            Post deletedPost = GetPostWith(id);

            postContext.Remove(GetPostWith(id));
            postContext.SaveChanges();

            return(deletedPost);
        }
        public void Delete(int id)
        {
            var deleteItem = (from deleteOne in RedditContext.Reddits
                              where deleteOne.Id == id
                              select deleteOne).FirstOrDefault();

            RedditContext.Remove(deleteItem);
            RedditContext.SaveChanges();
        }
 public void DeletePost(Post post)
 {
     redditContext.Remove(post);
     redditContext.SaveChanges();
 }
 public void DeleteUser(User user)
 {
     UserDb.Remove(user);
     UserDb.SaveChanges();
 }