Classe Factory che si occupa della creazione dei Repository in modo da mascherare le classi specializzate. Le classi create per essere richiamate dalla Factory devono essere contenute nel namespace Persistence.RepositoryImpl e devono chiamarsi NomeTipoRepository e devono avere un attributo costante chiamato RepositoryType contenente una stringa che identifica il tipo del repository. Il tipo del repository viene usato dalla Factory per generarne un'istanza.
예제 #1
0
        internal ShipMethodService(IDatabaseUnitOfWorkProvider provider, RepositoryFactory repositoryFactory)
        {
            Mandate.ParameterNotNull(provider, "provider");
            Mandate.ParameterNotNull(repositoryFactory, "repositoryFactory");

            _uowProvider = provider;
            _repositoryFactory = repositoryFactory;
        }
예제 #2
0
        public ItemCacheService(IDatabaseUnitOfWorkProvider provider, RepositoryFactory repositoryFactory)
        {
            Mandate.ParameterNotNull(provider, "provider");
            Mandate.ParameterNotNull(repositoryFactory, "repositoryFactory");

            _uowProvider = provider;
            _repositoryFactory = repositoryFactory;
        }
예제 #3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ShipmentService"/> class.
        /// </summary>
        /// <param name="provider">
        /// The provider.
        /// </param>
        /// <param name="repositoryFactory">
        /// The repository factory.
        /// </param>
        /// <param name="storeSettingService">
        /// The store Setting Service.
        /// </param>
        public ShipmentService(IDatabaseUnitOfWorkProvider provider, RepositoryFactory repositoryFactory, IStoreSettingService storeSettingService)
        {
            Mandate.ParameterNotNull(provider, "provider");
            Mandate.ParameterNotNull(repositoryFactory, "repositoryFactory");
            Mandate.ParameterNotNull(storeSettingService, "storeSettingService");

            _uowProvider = provider;
            _repositoryFactory = repositoryFactory;
            _storeSettingService = storeSettingService;
        }
예제 #4
0
        /// <summary>
        /// Initializes a new instance of the <see cref="WarehouseCatalogService"/> class.
        /// </summary>
        /// <param name="provider">
        /// The provider.
        /// </param>
        /// <param name="repositoryFactory">
        /// The repository factory.
        /// </param>
        /// <param name="productVariantService">
        /// The product Variant Service.
        /// </param>
        internal WarehouseCatalogService(IDatabaseUnitOfWorkProvider provider, RepositoryFactory repositoryFactory, IProductVariantService productVariantService)
        {
            Mandate.ParameterNotNull(provider, "provider");
            Mandate.ParameterNotNull(repositoryFactory, "repositoryFactory");
            Mandate.ParameterNotNull(productVariantService, "productVariantService");

            _uowProvider = provider;
            _repositoryFactory = repositoryFactory;
            _productVariantService = productVariantService;
        }
예제 #5
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ProductService"/> class.
        /// </summary>
        /// <param name="provider">
        /// The provider.
        /// </param>
        /// <param name="repositoryFactory">
        /// The repository factory.
        /// </param>
        /// <param name="productVariantService">
        /// The product variant service.
        /// </param>
        public ProductService(IDatabaseUnitOfWorkProvider provider, RepositoryFactory repositoryFactory, IProductVariantService productVariantService)
        {
            Mandate.ParameterNotNull(provider, "provider");
            Mandate.ParameterNotNull(repositoryFactory, "repositoryFactory");
            Mandate.ParameterNotNull(productVariantService, "productVariantService");

            _uowProvider = provider;
            _repositoryFactory = repositoryFactory;

            // included the ProductVariantService so that events will trigger if variants
            // need to be deleted due to a product save removing attributes
            _productVariantService = productVariantService;
        }
예제 #6
0
        /// <summary>
        /// Initializes a new instance of the <see cref="StoreSettingService"/> class.
        /// </summary>
        /// <param name="provider">
        /// The provider.
        /// </param>
        /// <param name="repositoryFactory">
        /// The repository factory.
        /// </param>
        public StoreSettingService(IDatabaseUnitOfWorkProvider provider, RepositoryFactory repositoryFactory)
        {
            Mandate.ParameterNotNull(provider, "provider");
            Mandate.ParameterNotNull(repositoryFactory, "repositoryFactory");

            _uowProvider = provider;
            _repositoryFactory = repositoryFactory;

            if (!RegionProvinceCache.IsEmpty) return;

            foreach (RegionElement region in MerchelloConfiguration.Current.Section.RegionalProvinces)
            {
                CacheRegion(
                    region.Code,
                    (from ProvinceElement pe in region.ProvincesConfiguration select new Province(pe.Code, pe.Name)).Cast<IProvince>().ToArray());
            }
        }
예제 #7
0
 /// <summary>
 /// Initializes a new instance of the <see cref="StoreSettingService"/> class.
 /// </summary>
 /// <param name="repositoryFactory">
 /// The repository factory.
 /// </param>
 public StoreSettingService(RepositoryFactory repositoryFactory)
     : this(new PetaPocoUnitOfWorkProvider(), repositoryFactory)
 {
 }
예제 #8
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ItemCacheService"/> class.
 /// </summary>
 /// <param name="repositoryFactory">
 /// The repository factory.
 /// </param>
 /// <param name="logger">
 /// The logger.
 /// </param>
 public ItemCacheService(RepositoryFactory repositoryFactory, ILogger logger)
     : this(new PetaPocoUnitOfWorkProvider(logger), repositoryFactory, logger)
 {
 }
예제 #9
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ShipmentService"/> class.
 /// </summary>
 /// <param name="repositoryFactory">
 /// The repository factory.
 /// </param>
 /// <param name="logger">
 /// The logger.
 /// </param>
 public ShipmentService(RepositoryFactory repositoryFactory, ILogger logger)
     : this(new PetaPocoUnitOfWorkProvider(logger), repositoryFactory, logger, new StoreSettingService(repositoryFactory, logger))
 {
 }
예제 #10
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ShipmentService"/> class.
 /// </summary>
 /// <param name="provider">
 /// The provider.
 /// </param>
 /// <param name="repositoryFactory">
 /// The repository factory.
 /// </param>
 /// <param name="logger">
 /// The logger.
 /// </param>
 /// <param name="storeSettingService">
 /// The store Setting Service.
 /// </param>
 public ShipmentService(IDatabaseUnitOfWorkProvider provider, RepositoryFactory repositoryFactory, ILogger logger, IStoreSettingService storeSettingService)
     : this(provider, repositoryFactory, logger, new TransientMessageFactory(), storeSettingService)
 {
 }
예제 #11
0
 internal ShipMethodService(RepositoryFactory repositoryFactory)
     : this(new PetaPocoUnitOfWorkProvider(), repositoryFactory)
 { }
예제 #12
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ShipmentService"/> class.
 /// </summary>
 /// <param name="provider">
 /// The provider.
 /// </param>
 /// <param name="repositoryFactory">
 /// The repository factory.
 /// </param>
 /// <param name="logger">
 /// The logger.
 /// </param>
 /// <param name="eventMessagesFactory">
 /// The event messages factory.
 /// </param>
 /// <param name="storeSettingService">
 /// The store setting service.
 /// </param>
 public ShipmentService(IDatabaseUnitOfWorkProvider provider, RepositoryFactory repositoryFactory, ILogger logger, IEventMessagesFactory eventMessagesFactory, IStoreSettingService storeSettingService)
     : base(provider, repositoryFactory, logger, eventMessagesFactory)
 {
     Mandate.ParameterNotNull(storeSettingService, "storeSettingService");
     _storeSettingService = storeSettingService;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="AppliedPaymentService"/> class.
 /// </summary>
 /// <param name="logger">
 /// The logger.
 /// </param>
 /// <param name="repositoryFactory">
 /// The repository factory.
 /// </param>
 public AppliedPaymentService(ILogger logger, RepositoryFactory repositoryFactory)
     : this(new PetaPocoUnitOfWorkProvider(logger), repositoryFactory, logger)
 {
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="CustomerAddressService"/> class.
 /// </summary>
 /// <param name="provider">
 /// The provider.
 /// </param>
 /// <param name="repositoryFactory">
 /// The repository factory.
 /// </param>
 /// <param name="logger">
 /// The logger.
 /// </param>
 /// <param name="eventMessagesFactory">
 /// The event messages factory.
 /// </param>
 public CustomerAddressService(IDatabaseUnitOfWorkProvider provider, RepositoryFactory repositoryFactory, ILogger logger, IEventMessagesFactory eventMessagesFactory)
     : base(provider, repositoryFactory, logger, eventMessagesFactory)
 {
 }
예제 #15
0
 /// <summary>
 /// Initializes a new instance of the <see cref="WarehouseCatalogService"/> class.
 /// </summary>
 /// <param name="provider">
 /// The provider.
 /// </param>
 /// <param name="repositoryFactory">
 /// The repository factory.
 /// </param>
 /// <param name="logger">
 /// The logger.
 /// </param>
 /// <param name="eventMessagesFactory">
 /// The event messages factory.
 /// </param>
 /// <param name="productVariantService">
 /// The product variant service.
 /// </param>
 internal WarehouseCatalogService(IDatabaseUnitOfWorkProvider provider, RepositoryFactory repositoryFactory, ILogger logger, IEventMessagesFactory eventMessagesFactory, IProductVariantService productVariantService)
     : base(provider, repositoryFactory, logger, eventMessagesFactory)
 {
     Mandate.ParameterNotNull(productVariantService, "productVariantService");
     _productVariantService = productVariantService;
 }
예제 #16
0
 /// <summary>
 /// Initializes a new instance of the <see cref="WarehouseCatalogService"/> class.
 /// </summary>
 /// <param name="provider">
 /// The provider.
 /// </param>
 /// <param name="repositoryFactory">
 /// The repository factory.
 /// </param>
 /// <param name="logger">
 /// The logger.
 /// </param>
 /// <param name="productVariantService">
 /// The product Variant Service.
 /// </param>
 internal WarehouseCatalogService(IDatabaseUnitOfWorkProvider provider, RepositoryFactory repositoryFactory, ILogger logger, IProductVariantService productVariantService)
     : this(provider, repositoryFactory, logger, new TransientMessageFactory(), productVariantService)
 {
 }
예제 #17
0
 public ItemCacheService(RepositoryFactory repositoryFactory)
     : this(new PetaPocoUnitOfWorkProvider(), repositoryFactory)
 {
 }
예제 #18
0
 /// <summary>
 /// Initializes a new instance of the <see cref="AppliedPaymentService"/> class.
 /// </summary>
 /// <param name="repositoryFactory">
 /// The repository factory.
 /// </param>
 public AppliedPaymentService(RepositoryFactory repositoryFactory)
     : this(new PetaPocoUnitOfWorkProvider(), repositoryFactory)
 {            
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="CustomerAddressService"/> class.
 /// </summary>
 /// <param name="repositoryFactory">
 /// The repository factory.
 /// </param>
 /// <param name="logger">
 /// The logger.
 /// </param>
 public CustomerAddressService(RepositoryFactory repositoryFactory, ILogger logger)
     : this(new PetaPocoUnitOfWorkProvider(logger), repositoryFactory, logger)
 {
 }
예제 #20
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ShipCountryService"/> class.
 /// </summary>
 /// <param name="repositoryFactory">
 /// The repository factory.
 /// </param>
 /// <param name="storeSettingService">
 /// The store setting service.
 /// </param>
 public ShipCountryService(RepositoryFactory repositoryFactory, IStoreSettingService storeSettingService)
     : this(new PetaPocoUnitOfWorkProvider(), repositoryFactory, storeSettingService)
 {
     
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="CustomerAddressService"/> class.
 /// </summary>
 /// <param name="provider">
 /// The provider.
 /// </param>
 /// <param name="repositoryFactory">
 /// The repository factory.
 /// </param>
 /// <param name="logger">
 /// The logger.
 /// </param>
 public CustomerAddressService(IDatabaseUnitOfWorkProvider provider, RepositoryFactory repositoryFactory, ILogger logger)
     : this(provider, repositoryFactory, logger, new TransientMessageFactory())
 {
 }
예제 #22
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CustomerAddressService"/> class.
 /// </summary>
 /// <param name="repositoryFactory">
 /// The repository factory.
 /// </param>
 public CustomerAddressService(RepositoryFactory repositoryFactory)
     : this(new PetaPocoUnitOfWorkProvider(), repositoryFactory)
 {
 }
예제 #23
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ShipMethodService"/> class.
 /// </summary>
 /// <param name="provider">
 /// The provider.
 /// </param>
 /// <param name="repositoryFactory">
 /// The repository factory.
 /// </param>
 /// <param name="logger">
 /// The logger.
 /// </param>
 /// <param name="eventMessagesFactory">
 /// The event messages factory.
 /// </param>
 internal ShipMethodService(IDatabaseUnitOfWorkProvider provider, RepositoryFactory repositoryFactory, ILogger logger, IEventMessagesFactory eventMessagesFactory)
     : base(provider, repositoryFactory, logger, eventMessagesFactory)
 {
 }
예제 #24
0
 /// <summary>
 /// Initializes a new instance of the <see cref="WarehouseCatalogService"/> class.
 /// </summary>
 /// <param name="repositoryFactory">
 /// The repository factory.
 /// </param>
 /// <param name="logger">
 /// The logger.
 /// </param>
 /// <param name="productVariantService">
 /// The product Variant Service.
 /// </param>
 internal WarehouseCatalogService(RepositoryFactory repositoryFactory, ILogger logger, IProductVariantService productVariantService)
     : this(new PetaPocoUnitOfWorkProvider(logger), repositoryFactory, logger, productVariantService)
 {
 }
예제 #25
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ShipMethodService"/> class.
 /// </summary>
 /// <param name="repositoryFactory">
 /// The repository factory.
 /// </param>
 /// <param name="logger">
 /// The logger.
 /// </param>
 internal ShipMethodService(RepositoryFactory repositoryFactory, ILogger logger)
     : this(new PetaPocoUnitOfWorkProvider(logger), repositoryFactory, logger)
 {
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="AppliedPaymentService"/> class.
 /// </summary>
 /// <param name="provider">
 /// The provider.
 /// </param>
 /// <param name="repositoryFactory">
 /// The repository factory.
 /// </param>
 /// <param name="logger">
 /// The logger.
 /// </param>
 /// <param name="eventMessagesFactory">
 /// The event messages factory.
 /// </param>
 public AppliedPaymentService(IDatabaseUnitOfWorkProvider provider, RepositoryFactory repositoryFactory, ILogger logger, IEventMessagesFactory eventMessagesFactory)
     : base(provider, repositoryFactory, logger, eventMessagesFactory)
 {
 }
예제 #27
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ShipMethodService"/> class.
 /// </summary>
 /// <param name="provider">
 /// The provider.
 /// </param>
 /// <param name="repositoryFactory">
 /// The repository factory.
 /// </param>
 /// <param name="logger">
 /// The logger.
 /// </param>
 internal ShipMethodService(IDatabaseUnitOfWorkProvider provider, RepositoryFactory repositoryFactory, ILogger logger)
     : this(provider, repositoryFactory, logger, new TransientMessageFactory())
 {
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="AppliedPaymentService"/> class.
 /// </summary>
 /// <param name="provider">
 /// The provider.
 /// </param>
 /// <param name="repositoryFactory">
 /// The repository factory.
 /// </param>
 /// <param name="logger">
 /// The logger.
 /// </param>
 public AppliedPaymentService(IDatabaseUnitOfWorkProvider provider, RepositoryFactory repositoryFactory, ILogger logger)
     : this(provider, repositoryFactory, logger, new TransientMessageFactory())
 {
 }
예제 #29
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ProductService"/> class.
 /// </summary>
 /// <param name="repositoryFactory">
 /// The repository factory.
 /// </param>
 /// <param name="productVariantService">
 /// The product variant service.
 /// </param>
 public ProductService(RepositoryFactory repositoryFactory, IProductVariantService productVariantService)
     : this(new PetaPocoUnitOfWorkProvider(), repositoryFactory, productVariantService)
 {
 }