public void Run(IBasicPersistenceProvider provider)
		{
			if (this.IsFirstRun)
			{
				OnBeforeRun(provider);
			}
			else
			{
				provider.DeleteAll<Category>();
				provider.DeleteAll<Customer>();
				provider.DeleteAll<Employee>();
				provider.DeleteAll<Shipper>();
				provider.DeleteAll<Order>();
				provider.DeleteAll<OrderDetail>();
				provider.DeleteAll<CustomerCustomerDemo>();
				provider.DeleteAll<Region>();
				provider.DeleteAll<Territory>();
				provider.DeleteAll<EmployeeTerritory>();
			}

			provider.StoreAll(NorthwindData.Categories);
			provider.StoreAll(NorthwindData.Customers);
			provider.StoreAll(NorthwindData.Employees);
			provider.StoreAll(NorthwindData.Shippers);
			provider.StoreAll(NorthwindData.Orders);
			provider.StoreAll(NorthwindData.OrderDetails);
			provider.StoreAll(NorthwindData.CustomerCustomerDemos);
			provider.StoreAll(NorthwindData.Regions);
			provider.StoreAll(NorthwindData.Territories);
			provider.StoreAll(NorthwindData.EmployeeTerritories);
		}
        public void Run(IBasicPersistenceProvider provider)
        {
            if (this.IsFirstRun)
            {
                OnBeforeRun(provider);
            }
            else
            {
                provider.DeleteAll <Category>();
                provider.DeleteAll <Customer>();
                provider.DeleteAll <Employee>();
                provider.DeleteAll <Shipper>();
                provider.DeleteAll <Order>();
                provider.DeleteAll <OrderDetail>();
                provider.DeleteAll <CustomerCustomerDemo>();
                provider.DeleteAll <Region>();
                provider.DeleteAll <Territory>();
                provider.DeleteAll <EmployeeTerritory>();
            }

            provider.StoreAll(NorthwindData.Categories);
            provider.StoreAll(NorthwindData.Customers);
            provider.StoreAll(NorthwindData.Employees);
            provider.StoreAll(NorthwindData.Shippers);
            provider.StoreAll(NorthwindData.Orders);
            provider.StoreAll(NorthwindData.OrderDetails);
            provider.StoreAll(NorthwindData.CustomerCustomerDemos);
            provider.StoreAll(NorthwindData.Regions);
            provider.StoreAll(NorthwindData.Territories);
            provider.StoreAll(NorthwindData.EmployeeTerritories);
        }
		public override void OnBeforeRun(IBasicPersistenceProvider provider)
		{
			var ormLiteProvider = (OrmLitePersistenceProvider) provider;
			using (var dbCmd = ormLiteProvider.Connection.CreateCommand())
			{
				dbCmd.CreateTables(true, NorthwindFactory.ModelTypes.ToArray());
			}
		}
        public override void OnBeforeRun(IBasicPersistenceProvider provider)
        {
            var ormLiteProvider = (OrmLitePersistenceProvider)provider;

            using (var dbCmd = ormLiteProvider.Connection.CreateCommand())
            {
                dbCmd.CreateTables(true, NorthwindFactory.ModelTypes.ToArray());
            }
        }
		private static void LoadNorthwindData(IBasicPersistenceProvider persistenceProvider)
		{
			persistenceProvider.StoreAll(NorthwindData.Categories);
			persistenceProvider.StoreAll(NorthwindData.Customers);
			persistenceProvider.StoreAll(NorthwindData.Employees);
			persistenceProvider.StoreAll(NorthwindData.Shippers);
			persistenceProvider.StoreAll(NorthwindData.Orders);
			persistenceProvider.StoreAll(NorthwindData.Products);
			persistenceProvider.StoreAll(NorthwindData.OrderDetails);
			persistenceProvider.StoreAll(NorthwindData.CustomerCustomerDemos);
			persistenceProvider.StoreAll(NorthwindData.Regions);
			persistenceProvider.StoreAll(NorthwindData.Territories);
			persistenceProvider.StoreAll(NorthwindData.EmployeeTerritories);
		}
示例#6
0
 private static void LoadNorthwindData(IBasicPersistenceProvider persistenceProvider)
 {
     persistenceProvider.StoreAll(NorthwindData.Categories);
     persistenceProvider.StoreAll(NorthwindData.Customers);
     persistenceProvider.StoreAll(NorthwindData.Employees);
     persistenceProvider.StoreAll(NorthwindData.Shippers);
     persistenceProvider.StoreAll(NorthwindData.Orders);
     persistenceProvider.StoreAll(NorthwindData.Products);
     persistenceProvider.StoreAll(NorthwindData.OrderDetails);
     persistenceProvider.StoreAll(NorthwindData.CustomerCustomerDemos);
     persistenceProvider.StoreAll(NorthwindData.Regions);
     persistenceProvider.StoreAll(NorthwindData.Territories);
     persistenceProvider.StoreAll(NorthwindData.EmployeeTerritories);
 }
		public virtual void OnBeforeRun(IBasicPersistenceProvider provider) {}
 public virtual void OnBeforeRun(IBasicPersistenceProvider provider)
 {
 }