コード例 #1
0
        private static void PopulatedDb(Context context)
        {
            ClearDb(context);

            context.Posts.Add(new Post {
                Id = 1, PublishDate = TestValues.DateInPast()
            });
            context.Posts.Add(new Post {
                Id = 2, PublishDate = TestValues.DateInPast()
            });
            context.Posts.Add(new Post {
                Id = 3, PublishDate = TestValues.DateInFuture()
            });
            context.SaveChanges();
        }