示例#1
0
        public ShoppingCartService(IKenticoSiteProvider kenticoSite,
                                   IKenticoLocalizationProvider localization,
                                   IKenticoPermissionsProvider permissions,
                                   IKenticoUserProvider kenticoUsers,
                                   IKenticoResourceService resources,
                                   ITaxEstimationService taxCalculator,
                                   IKListService mailingService,
                                   IShoppingCartProvider shoppingCart,
                                   ICheckoutPageFactory checkoutfactory)
        {
            if (kenticoSite == null)
            {
                throw new ArgumentNullException(nameof(kenticoSite));
            }
            if (localization == null)
            {
                throw new ArgumentNullException(nameof(localization));
            }
            if (permissions == null)
            {
                throw new ArgumentNullException(nameof(permissions));
            }
            if (kenticoUsers == null)
            {
                throw new ArgumentNullException(nameof(kenticoUsers));
            }
            if (resources == null)
            {
                throw new ArgumentNullException(nameof(resources));
            }
            if (taxCalculator == null)
            {
                throw new ArgumentNullException(nameof(taxCalculator));
            }
            if (mailingService == null)
            {
                throw new ArgumentNullException(nameof(mailingService));
            }
            if (shoppingCart == null)
            {
                throw new ArgumentNullException(nameof(shoppingCart));
            }
            if (checkoutfactory == null)
            {
                throw new ArgumentNullException(nameof(checkoutfactory));
            }

            this.kenticoSite     = kenticoSite;
            this.localization    = localization;
            this.permissions     = permissions;
            this.kenticoUsers    = kenticoUsers;
            this.resources       = resources;
            this.taxCalculator   = taxCalculator;
            this.mailingService  = mailingService;
            this.shoppingCart    = shoppingCart;
            this.checkoutfactory = checkoutfactory;
        }
        public KListController(IKListService service, IMapper mapper)
        {
            if (service == null)
            {
                throw new ArgumentNullException(nameof(service));
            }
            if (mapper == null)
            {
                throw new ArgumentNullException(nameof(mapper));
            }

            _service = service;
            _mapper  = mapper;
        }