示例#1
0
        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);
        }
示例#2
0
 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);
 }
示例#3
0
 public async Task Generate()
 {
     await Task.WhenAll(TableToGeneratorMappings.Select(x => x.Value.GetTask()).ToArray());
 }