public void AddReddit(string content)
        {
            var myReddit = new Reddit()
            {
                Content = content
            };

            RedditContext.Add(myReddit);
            RedditContext.SaveChanges();
        }
Beispiel #2
0
 public Post Create(Post post)
 {
     postContext.Add(post);
     postContext.SaveChanges();
     return(post);
 }
        //CRUD

        public void CreateUser(User user)
        {
            UserDb.Add(user);
            UserDb.SaveChanges();
        }
 public void AddNewPost(Post post)
 {
     redditContext.Add(post);
     redditContext.SaveChanges();
 }
        //CRUD

        public void Create(Post post)
        {
            postsDb.Add(post);
            postsDb.SaveChanges();
        }