public override void Initialize()
        {
            //#region Payment gateways manager

            //_container.RegisterType<IPaymentGatewayManager, InMemoryPaymentGatewayManagerImpl>(new ContainerControlledLifetimeManager());

            //#endregion

            #region Fulfillment

            _container.RegisterType <IСommerceRepository>(new InjectionFactory(c => new CommerceRepositoryImpl(_connectionStringName, new EntityPrimaryKeyGeneratorInterceptor(), new AuditableInterceptor())));
            _container.RegisterType <ICommerceService, CommerceServiceImpl>();

            #endregion

            #region Shipping service
            var shippingService = new ShippingServiceImpl();
            _container.RegisterInstance <IShippingService>(shippingService);
            #endregion

            #region Payment service
            var paymentService = new PaymentMethodsServiceImpl();
            _container.RegisterInstance <IPaymentMethodsService>(paymentService);
            #endregion
        }
Exemple #2
0
        private StoreModuleController GetStoreController()
        {
            Func <IStoreRepository> repositoryFactory = () =>
            {
                return(new StoreRepositoryImpl("VirtoCommerce", new EntityPrimaryKeyGeneratorInterceptor(), new AuditableInterceptor()));
            };

            var shippingService = new ShippingServiceImpl();
            var storeService    = new StoreServiceImpl(repositoryFactory, GetCommerceService(), null, null, null);
            var controller      = new StoreModuleController(storeService, null, null);

            return(controller);
        }