public IDisposable SeedData(SuiteMySQLDbContext data) { var persons = Fixture.Build <Person>().FromFactory(() => { var p = new Person("Name"); p.RegisterAddress(Fixture.Create <Address>()); return(p); }).CreateMany <Person>(100).ToList(); data.Set <Person>().AddRange(persons); data.SaveChanges(); return(new CleanupResource(data)); }
public CleanupResource(SuiteMySQLDbContext mySqlDbContext) { _mySqlDbContext = mySqlDbContext; }
public IDisposable InitializeDatabase(SuiteMySQLDbContext suiteMySqlDbContext) { suiteMySqlDbContext.Database.EnsureCreated(); return(new CleanupResource(suiteMySqlDbContext)); }