public static void Setup()
        {
            using (var db = new InMemoryDB())
            {
                db.Database.EnsureDeleted();
                db.Database.EnsureCreated();

                var dad = new Dad()
                {
                    Name = "Tata"
                };

                var person = new Child()
                {
                    Name = "Pawel", Dad = dad
                };
                db.Add(person);
                db.SaveChanges();
            }
        }
Пример #2
0
 public Service(InMemoryDB db)
 {
     this.memory = db;
 }