public static void CreateOneComment(MyStoryContext dbContext) { var comment = new Comment { Content = CommentContent, DateCreated = DateTime.Now, PostId = 1, CommenterId = 1, }; dbContext.Comments.Add(comment); dbContext.SaveChanges(); }
public static void CreateOnePost(MyStoryContext dbContext) { var blogId = dbContext.Blogs.SingleOrDefault().Id; dbContext.Posts.Add(new Post { Id = 1, BlogId = blogId, Content = PostContent, DateCreated = DateTime.Now, DateModified = DateTime.Now, Title = PostTitle, LocationOfWriting = new Location() }); dbContext.SaveChanges(); }
public static void CreateAccountAndBlog(MyStoryContext dbContext) { dbContext.Blogs.Add(new Blog { Title = BlogTitle, BlogOwner = new Account { Email = AccountEmail, Password = AccountPasword, Name = AccountName } }); dbContext.SaveChanges(); }
public static void CreateOneCommenter(MyStoryContext dbContext) { var commenter = new Commenter { Id = 1, Name = CommenterName, Email = CommenterEmail }; dbContext.Commenters.Add(commenter); dbContext.SaveChanges(); }