Beispiel #1
0
        public int PostTest(Models.Post post)
        {
            var db = new Entity.DatabaseContext();
            var p  = new Entity.Post
            {
                BlogId = post.BlogId
                ,
                Content = post.Content
                ,
                Title = post.Title
            };

            db.Posts.Add(p);
            db.SaveChanges();
            return(db.Posts.Count());
        }
Beispiel #2
0
 public int PostTest(Models.Post post)
 {
     var db = new Entity.DatabaseContext();
     var p = new Entity.Post
     {
         BlogId=post.BlogId
         ,
         Content=post.Content
         ,
         Title=post.Title
     };
     db.Posts.Add(p);
     db.SaveChanges();
     return db.Posts.Count();
 }