/// <summary> /// Constructor. /// You can use a dependency injection container to initialize the services. /// </summary> public ProductFilterController() { //DocSection:ServiceInit shoppingService = new ShoppingService(); pricingService = new PricingService(); //EndDocSection:ServiceInit }
//DocSection:Controller /// <summary> /// Constructor for the ProductFilterController class. /// </summary> public ProductFilterController() { // Initializes instances of services required to facilitate product filtering // For real-world projects, we recommend using a dependency injection container to initialize service instances shoppingService = Service.Resolve <IShoppingService>(); calculatorFactory = Service.Resolve <ICatalogPriceCalculatorFactory>(); }
public ShoppingController(IHttpRequest httpRequest) : base(httpRequest) { this.shoppingService = new ShoppingService(); this.userService = new UserService(); this.gameService = new GameService(); }
//DocSection:Constructor /// <summary> /// Initializes an instance of the IShoppingService used to facilitate shopping cart interactions. /// </summary> public CheckoutController() { // Initializes an instance of a service required to manage the shopping cart // For real-world projects, we recommend using a dependency injection // container to initialize service instances shoppingService = Service.Resolve <IShoppingService>(); }
//DocSection:Constructor /// <summary> /// Constructor for the OrderController class. /// </summary> public OrderController() { // Initializes an instance of IShoppingService used to facilitate shopping cart interactions // For real-world projects, we recommend using a dependency injection // container to initialize service instances shoppingService = Service.Resolve <IShoppingService>(); }
/// <summary> /// Constructor for the LearningProductTypeController class. /// </summary> public LearningProductTypeController() { // Initializes instances of services required to manage product price calculation and the shopping cart // For real-world projects, we recommend using a dependency injection container to initialize service instances shoppingService = Service.Resolve <IShoppingService>(); calculatorFactory = Service.Resolve <ICatalogPriceCalculatorFactory>(); }
public CheckoutController(IShoppingService shoppingService, IContactRepository contactRepository, IProductRepository productRepository, ICheckoutService checkoutService) { mShoppingService = shoppingService; mContactRepository = contactRepository; mCheckoutService = checkoutService; mProductRepository = productRepository; }
/// <summary> /// Constructor. /// You can use a dependency injection container to initialize the services and repositories. /// </summary> public CheckoutController() { shoppingService = new ShoppingService(); pricingService = new PricingService(); paymentRepository = new KenticoPaymentMethodRepository(); addressRepository = new KenticoCustomerAddressRepository(); shippingOptionRepository = new KenticoShippingOptionRepository(); }
public AccountController( IAccountService accountService, IShoppingService shoppingService) { _accountService = accountService; _shoppingService = shoppingService; _account = new Account(); }
public ECUtilitiesController(ISiteService siteService, IShoppingService shoppingService, ISKUInfoProvider sKUInfoProvider) { this.siteService = siteService; this.shoppingService = shoppingService; this.sKUInfoProvider = sKUInfoProvider; }
/// <summary> /// Constructor. /// </summary> /// <param name="shoppingService">Shopping service</param> /// <param name="addressRepository">Address repository</param> /// <param name="paymentMethodRepository">Payment method repository</param> /// <param name="shippingOptionRepository">Shipping option repository</param> /// <param name="countryRepository">Country repository</param> public CheckoutService(IShoppingService shoppingService, ICustomerAddressRepository addressRepository, IPaymentMethodRepository paymentMethodRepository, IShippingOptionRepository shippingOptionRepository, ICountryRepository countryRepository) { mShoppingService = shoppingService; mPaymentMethodRepository = paymentMethodRepository; mShippingOptionRepository = shippingOptionRepository; mCountryRepository = countryRepository; mAddressRepository = addressRepository; }
/// <summary> /// Constructor. /// You can use a dependency injection container to initialize the services and repositories. /// </summary> public ProductController() { //DocSection:InitializeServices shoppingService = new ShoppingService(); pricingService = new PricingService(); variantRepository = new KenticoVariantRepository(); //EndDocSection:InitializeServices }
public void TestSetup() { _shoppingService = new ShoppingService(); CreateTestData(); _customer = _shoppingService.GetCustomerByName("Tony Stark"); _customer.ShoppingCart.CustomerName = _customer.Name; }
public ProductController(ICalculationService calculationService, IProductRepository productRepository, IVariantRepository variantRepository, TypedProductViewModelFactory typedProductViewModelFactory, IShoppingService shoppingService) { mCalculationService = calculationService; mProductRepository = productRepository; mVariantRepository = variantRepository; mTypedProductViewModelFactory = typedProductViewModelFactory; mShoppingService = shoppingService; }
static SessionManager() { IIoCManager iocManager = (IIoCManager)HttpContext.Current.Application["managerIoC"]; userService = iocManager.Resolve <IUserService>(); shoppingService = iocManager.Resolve <IShoppingService>(); productService = iocManager.Resolve <IProductService>(); }
public static IShoppingService ShoppingService(SQLiteConnection sqliteConnection) { if (_shoppingService == null) { _shoppingService = new ShoppingService(sqliteConnection); } return _shoppingService; }
public static IShoppingService ShoppingService(SQLiteConnection sqliteConnection) { if (_shoppingService == null) { _shoppingService = new ShoppingService(sqliteConnection); } return(_shoppingService); }
/// <summary> /// Initializes instances of services required to manage product price calculation and the shopping cart. /// </summary> public ProductListingController(IShoppingService shoppingService, ICatalogPriceCalculatorFactory priceCalculatorFactory, IPageRetriever pageRetriever, IPageUrlRetriever pageUrlRetriever) { this.shoppingService = shoppingService; this.priceCalculatorFactory = priceCalculatorFactory; this.pageRetriever = pageRetriever; this.pageUrlRetriever = pageUrlRetriever; }
public CodeSnippets(IShoppingService shoppingService, ICatalogPriceCalculatorFactory catalogPriceCalculatorFactory, ISiteService siteService, IPageDataContextRetriever pageRetriever) { this.shoppingService = shoppingService; this.catalogPriceCalculatorFactory = catalogPriceCalculatorFactory; this.siteService = siteService; this.pageRetriever = pageRetriever; }
public ShoppingServiceTests() { var mockLogger = new Mock <ILogger <ShoppingService> >(); _mockShoppingRepository = new Mock <IShoppingRepository>(); _mockProductSorter = new Mock <IProductSorter>(); _mockTrolleyTotalCalculator = new Mock <ITrolleyTotalCalculator>(); _shoppingService = new ShoppingService(mockLogger.Object, _mockShoppingRepository.Object, _mockProductSorter.Object, _mockTrolleyTotalCalculator.Object); }
//DocSection:Controller /// <summary> /// Initializes instances of services required to facilitate product filtering. /// </summary> public ProductFilterController(IShoppingService shoppingService, ICatalogPriceCalculatorFactory catalogPriceCalculator, IPageUrlRetriever pageUrlRetriever, IPageRetriever pageRetriever) { this.shoppingService = shoppingService; this.catalogPriceCalculator = catalogPriceCalculator; this.pageUrlRetriever = pageUrlRetriever; this.pageRetriever = pageRetriever; }
public static void MyClassInitialize(TestContext testContext) { kernel = TestManager.ConfigureNInjectKernel(); shoppingService = kernel.Get <IShoppingService>(); userProfileDao = kernel.Get <IUserProfileDao>(); creditCardDao = kernel.Get <ICreditCardDao>(); categoryDao = kernel.Get <ICategoryDao>(); productDao = kernel.Get <IProductDao>(); }
//DocSection:Constructor /// <summary> /// Initializes instances of service used to facilitate shopping cart, currency and order interactions. /// </summary> public OrderController(IShoppingService shoppingService, ICurrencyInfoProvider currencyInfoProvider, IOrderInfoProvider orderInfoProvider, ISiteService siteService) { this.shoppingService = shoppingService; this.currencyInfoProvider = currencyInfoProvider; this.orderInfoProvider = orderInfoProvider; this.siteService = siteService; }
public OrdersController(OrderRepository orderRepository, IShoppingService shoppingService, ICurrencyInfoProvider currencyInfoProvider, IOrderStatusInfoProvider orderStatusInfoProvider, ICountryInfoProvider countryInfoProvider, IStateInfoProvider stateInfoProvider) { this.orderRepository = orderRepository; this.shoppingService = shoppingService; this.currencyInfoProvider = currencyInfoProvider; this.orderStatusInfoProvider = orderStatusInfoProvider; this.countryInfoProvider = countryInfoProvider; this.stateInfoProvider = stateInfoProvider; }
public void TestSetup() { _shoppingService = new ShoppingService(); CreateTestData(); Customer customer = _shoppingService.GetCustomerByName("John Smith"); _shoppingCart = customer.ShoppingCart; _shoppingCart.CustomerName = customer.Name; }
public ProductController(IPageDataContextRetriever dataRetriever, ICalculationService calculationService, VariantRepository variantRepository, TypedProductViewModelFactory typedProductViewModelFactory, IShoppingService shoppingService, ISKUInfoProvider skuInfoProvider) { this.dataRetriever = dataRetriever; this.calculationService = calculationService; this.variantRepository = variantRepository; this.typedProductViewModelFactory = typedProductViewModelFactory; this.shoppingService = shoppingService; this.skuInfoProvider = skuInfoProvider; }
public CheckoutController(IShoppingService shoppingService, IContactRepository contactRepository, IProductRepository productRepository, ICheckoutService checkoutService, IPageUrlRetriever pageUrlRetriever, ISKUInfoProvider skuInfoProvider, ICountryInfoProvider countryInfoProvider, IStateInfoProvider stateInfoProvider) { this.shoppingService = shoppingService; this.contactRepository = contactRepository; this.checkoutService = checkoutService; this.productRepository = productRepository; this.pageUrlRetriever = pageUrlRetriever; this.skuInfoProvider = skuInfoProvider; this.countryInfoProvider = countryInfoProvider; this.stateInfoProvider = stateInfoProvider; }
public ShoppingsTests() { _settings = new DatabaseSettings { ConnectionString = "mongodb://*****:*****@localhost:27017/admin", DatabaseName = "ShoppingListDb", ProductsCollectionName = "Products" }; _repository = new ShoppingRepository(_settings); _service = new ShoppingService(_repository); _controller = new ShoppingsController(_service); }
//DocSection:Constructor /// <summary> /// Constructor for the ProductController class. /// </summary> public ProductController(IShoppingService shoppingService, ICatalogPriceCalculatorFactory priceCalculatorFactory, IPageDataContextRetriever pageRetriever, ISiteService siteService, ISKUInfoProvider skuInfoProvider) { // Initializes instances of services required to manage product price calculation and the shopping cart this.shoppingService = shoppingService; this.priceCalculatorFactory = priceCalculatorFactory; this.pageRetriever = pageRetriever; this.siteService = siteService; this.skuInfoProvider = skuInfoProvider; }
public ShoppingCartController( IShoppingCartManager shoppingCartManager, ISongService songService, UserManager <User> userManager, IShoppingService shoppingService, IAlbumService albumsService) { this.shoppingCartManager = shoppingCartManager; this.songService = songService; this.userManager = userManager; this.shoppingService = shoppingService; this.albumsService = albumsService; }
public OrderController( UserManager <User> userManager, SignInManager <User> signInManager, IEmailSender emailSender, ISmsSender smsSender, IShoppingService shoppingService, ILoggerFactory loggerFactory) { _userManager = userManager; _emailSender = emailSender; _smsSender = smsSender; _shoppingService = shoppingService; _logger = loggerFactory.CreateLogger <OrderController>(); }
public PastPurchasesViewModel(IShoppingService shoppingService) { this._shoppingService = shoppingService; }
public ShoppingListViewModel(IShoppingService shoppingService) { this._shoppingService = shoppingService; }
public BuyController(IProductsService productsService, IShoppingService shoppingService) : base(productsService) { this.shoppingService = shoppingService; }