public void Insert(string url) { PostLazy post = new PostLazy() { Url = url }; post.PostComments.Add(new PostComment() { Comment = string.Format("yada yada {0}", counter++) }); context.Posts.Add(post); }
public async Task InsertAsync(string url) { PostLazy post = new PostLazy() { Url = url }; post.PostComments.Add(new PostComment() { Comment = string.Format("yada yada {0}", counter++) }); context.Posts.Add(post); context.SaveChanges(); }
private void ArrangeRecords() { BlogLazy blog = new BlogLazy() { Author = "Markus", Name = "Conversations" }; PostLazy post = new PostLazy() { Blog = blog, Category = "Scenario", Title = "The Convesration is here", Contents = "A new way for AR in fat clients", Created = new DateTime(2010, 1, 1), Published = true }; blog.Save(); post.Save(); }