예제 #1
0
        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();
            }
        }
예제 #2
0
 public CategoryGenerator(IRandomDataGenerator randomGenerator, ToyStoreEntities db, int count)
     : base(randomGenerator, db, count)
 {
 }
예제 #3
0
 public AgeRangeGenerator(IRandomDataGenerator randomGenerator, ToyStoreEntities db, int count)
     : base(randomGenerator, db, count)
 {
 }
예제 #4
0
 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)
 {
 }