static void Main(string[] args) { IRandomDataGenerator randomGenerator = RandomGenerator.Instance; ToyStoreEntities db = new ToyStoreEntities(); db.Configuration.AutoDetectChangesEnabled = false; var listOfGenerators = new List<IDataGenerator>() { new CategoryGenerator(randomGenerator,db, 100), new ManufacturerGenerator(randomGenerator,db, 50), new AgeRangeGenerator(randomGenerator,db, 100), new ToyStoreGenerator(randomGenerator,db, 1000) }; foreach (var generator in listOfGenerators) { generator.Generate(); db.SaveChanges(); } }
public CategoryGenerator(IRandomDataGenerator randomGenerator, ToyStoreEntities db, int count) : base(randomGenerator, db, count) { }
public AgeRangeGenerator(IRandomDataGenerator randomGenerator, ToyStoreEntities db, int count) : base(randomGenerator, db, count) { }
public DataGenerator(IRandomDataGenerator randomGenerator, ToyStoreEntities db, int count) { this.randomGenerator = randomGenerator; this.db = db; this.count = count; }
public ManufacturerGenerator(IRandomDataGenerator randomGenerator, ToyStoreEntities db, int count) : base(randomGenerator, db, count) { }