public static StoreRepositoryImpl getInstance(IApiProvider apiProvider, ICacheProvider cache, ILocalStorageProvider localStorage, JsonMapper jsonMapper)
 {
     if (instance == null)
     {
         instance = new StoreRepositoryImpl(apiProvider, cache, localStorage, jsonMapper);
     }
     return(instance);
 }
Пример #2
0
        public override void SetupDatabase()
        {
            using (var db = new StoreRepositoryImpl())
            {
                var initializer = new SetupDatabaseInitializer <StoreRepositoryImpl, Data.Migrations.Configuration>();

                initializer.InitializeDatabase(db);
            }
        }
Пример #3
0
        public override void SetupDatabase()
        {
            using (var db = new StoreRepositoryImpl(_connectionStringName, _container.Resolve <AuditableInterceptor>()))
            {
                var initializer = new SetupDatabaseInitializer <StoreRepositoryImpl, Data.Migrations.Configuration>();

                initializer.InitializeDatabase(db);
            }
        }
Пример #4
0
        public override void SetupDatabase(SampleDataLevel sampleDataLevel)
        {
            using (var db = new StoreRepositoryImpl("VirtoCommerce"))
            {
                IDatabaseInitializer <StoreRepositoryImpl> initializer;

                switch (sampleDataLevel)
                {
                case SampleDataLevel.Full:
                case SampleDataLevel.Reduced:
                    initializer = new SqlStoreSampleDatabaseInitializer(_container.Resolve <ISettingsManager>());
                    break;

                default:
                    initializer = new SetupDatabaseInitializer <StoreRepositoryImpl, Data.Migrations.Configuration>();
                    break;
                }

                initializer.InitializeDatabase(db);
            }
        }
        private static IStoreRepository GetStoreRepository()
        {
            var result = new StoreRepositoryImpl("VirtoCommerce", new EntityPrimaryKeyGeneratorInterceptor(), new AuditableInterceptor(null));

            return(result);
        }
 public static IStoreRepository injectStoreRepository()
 {
     return(StoreRepositoryImpl.getInstance(injectApiProvider(), injectCahceProvider(), injectLocalStorageProivder(), injectJsonMapper()));
 }