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()); }
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(); }