예제 #1
0
        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);
        }
예제 #2
0
        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();
        }
 	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();
 	}