private DatabaseContentRepositoryImpl GetRepository()
		{
			var repository = new DatabaseContentRepositoryImpl("VirtoCommerce", new AuditableInterceptor(),
															   new EntityPrimaryKeyGeneratorInterceptor());

			return repository;
		}
예제 #2
0
        public override void SetupDatabase(SampleDataLevel sampleDataLevel)
        {
            var options = _container.Resolve<IModuleInitializerOptions>();
            var modulePath = options.GetModuleDirectoryPath("VirtoCommerce.Content");
            var themePath = Path.Combine(modulePath, "Default_Theme");

            using (var context = new DatabaseContentRepositoryImpl())
            {
                var initializer = new SqlContentDatabaseInitializer(themePath, true);
                switch (sampleDataLevel)
                {
                    case SampleDataLevel.Full:
                        initializer.InitializeDatabase(context);
                        break;
                    default:
                        initializer = new SqlContentDatabaseInitializer(themePath, false);
                        initializer.InitializeDatabase(context);
                        break;
                }
            }
        }
예제 #3
0
        public override void SetupDatabase()
        {
            var options = _container.Resolve<IModuleInitializerOptions>();
            var modulePath = options.GetModuleDirectoryPath("VirtoCommerce.Content");
            var themePath = Path.Combine(modulePath, "Default_Theme");

            using (var context = new DatabaseContentRepositoryImpl())
            {
				var initializer = new SetupDatabaseInitializer<DatabaseContentRepositoryImpl, Data.Migrations.Configuration>();
                initializer.InitializeDatabase(context);
            }
        }
예제 #4
0
        public void SetupDatabase(SampleDataLevel sampleDataLevel)
        {
            var options = this._container.Resolve<IModuleInitializerOptions>();
            var modulePath = options.GetModuleDirectoryPath("VirtoCommerce.Content");
            var themePath = Path.Combine(modulePath, "Default_Theme");

			using (var context = new DatabaseContentRepositoryImpl())
            {
                var initializer = new SqlContentDatabaseInitializer(themePath);
                initializer.InitializeDatabase(context);
            }
        }
 public override void Dispose()
 {
     try
     {
         // Ensure LocalDb databases are deleted after use so that LocalDb doesn't throw if
         // the temp location in which they are stored is later cleaned.
         using (var context = new DatabaseContentRepositoryImpl(DatabaseName))
         {
             context.Database.Delete();
         }
     }
     finally
     {
     }
 }