private void SeedSEIFA_2011(SeedingContext context) { string resourceName = @"Repository.SeedData.SEIFA_2011.csv"; IScoreImportStrategy strategy = new ScoreImportStrategy(); Stream stream = GetStream(resourceName); strategy.SeedToContext(stream, context); }
public DataSeederTests() { var serviceProvider = new ServiceCollection() .AddEntityFrameworkInMemoryDatabase() .BuildServiceProvider(); _options = new DbContextOptionsBuilder <DotIdContext>() .UseInMemoryDatabase(Guid.NewGuid().ToString()) .UseInternalServiceProvider(serviceProvider) .Options; var context = new DotIdContext(_options); var locationSeeder = new LocationImportStrategy(context); var queryRepository = new QueryRepository(Options.Create(new ConnectionStrings() { SqlServer = "Server=localhost;Database=DotId;User Id=testuser;Password=testuser;" })); var scoreSeeder = new ScoreImportStrategy(context, queryRepository); _dataSeeder = new DataSeeder(locationSeeder, scoreSeeder); }