Beispiel #1
0
        static void SetupEntities(LinqKitIncludesContext ctx)
        {
            var parent = new Parent()
            {
                Name  = "Parent1",
                Child = new List <Child>
                {
                    new Child
                    {
                        Name = "Child1"
                    },
                    new Child
                    {
                        Name = "Child2"
                    }
                }
            };

            ctx.Parent.Add(parent);
            ctx.SaveChanges();
        }
Beispiel #2
0
 static void SetupDatabase(
     LinqKitIncludesContext ctx)
 {
     ctx.Database.EnsureDeleted();
     ctx.Database.EnsureCreated();
 }