public void Seed() { var data = new BattleNetShopSqLiteData(); var oldItems = data.GetAllProducTaxes(); foreach (var oldItem in oldItems) { data.Remove(oldItem); } data.SaveChanges(); var excelHander = new ExcelXlsHandler(); var random = new Random(); excelHander.ReadInitialDataFile("Products$", r => { data.AddProductTax(new ProductTax() { ProductName = r["Product Name"].ToString(), Amount = random.NextDouble() * random.Next(100, 200) }); }); data.SaveChanges(); }
public void Seed() { var data = new SqLiteData(); var oldItems = data.GetAllProducTaxes(); foreach (var oldItem in oldItems) { data.Remove(oldItem); } data.SaveChanges(); var excelHander = new ExcelXlsHandler(); excelHander.ReadInitialDataFile( "Products$", product => { data.AddProductTax( new ProductTax { ProductName = product["Product Name"].ToString(), Amount = Random.NextDouble() * Random.Next(100, 200) }); }); data.SaveChanges(); }
public void Seed() { this.mongoHandler = new MongoDbHandler(); this.excelHandler = new ExcelXlsHandler(); this.SeedVendors(); this.SeedCategories(); this.SeedDetails(); this.SeedProducts(); }
public void Seed() { this.mongoHandler = new MongoDbHandler(); this.excelHandler = new ExcelXlsHandler(); this.SeedVendors(); this.SeedCategories(); this.SeedDetails(); this.SeedProducts(); }