protected async Task <List <T> > EnsureRelatedEntities <T>() where T : class { SeedDataTaskWrapper d = null; TableToGeneratorMappings.TryGetValue(typeof(T), out d); return(await((SeedDataTaskWrapper <T>)d).Data); }
public SalesViewerDataGenerator MapTableToSeedMethod <T>(Func <SalesViewerContext, List <T> > table, Func <SalesViewerDataGenerator, Task <List <T> > > seed) where T : class { TableToGeneratorMappings.TryAdd(typeof(T), new SeedDataTaskWrapper <T>(this, table, () => seed(this))); return(this); }
public async Task Generate() { await Task.WhenAll(TableToGeneratorMappings.Select(x => x.Value.GetTask()).ToArray()); }