public SampleDataSeeder(IElasticClient elasticClient, SocialMediaListsDbContext socialMediaListsDbContext, DataSeedCollection dataSeedCollection) { _elasticClient = elasticClient; _socialMediaListsDbContext = socialMediaListsDbContext; _dataSeedCollection = dataSeedCollection; }
public MockDbContext() { var options = new DbContextOptionsBuilder <SocialMediaListsDbContext>() .UseInMemoryDatabase(databaseName: Guid.NewGuid().ToString()) .Options; DbContext = new SocialMediaListsDbContext(options); }
private static async Task SeedDataAsync(SocialMediaListsDbContext dbContext, IElasticClient elasticClient, DataSeedCollection seedCollection, CancellationToken cancellationToken) { var dataSeeder = new SampleDataSeeder(elasticClient, dbContext, seedCollection); await dataSeeder.SeedAsync(cancellationToken); }