Exemplo n.º 1
0
        /// <summary>
        /// Constructor - initializes a new instance of the ShoppingCart class.
        /// </summary>
        /// <param name="productStorage">Storage used to validate products and fetch their unit prices</param>
        /// <param name="discountStorage">Storage used to fetch all active discounts</param>
        /// <param name="logger">Logger used to log total cost calculations</param>
        public ShoppingCart(IProductStorage productStorage, IDiscountStorage discountStorage, IShoppingCartLogger logger = null)
        {
            //validate the storages
            this.productStorage  = productStorage ?? throw new ArgumentException("Product storage is null", "productStorage");
            this.discountStorage = discountStorage ?? throw new ArgumentException("Discount storage is null", "discountStorage");

            this.logger = logger ?? new ConsoleShoppingCartLogger();
        }
Exemplo n.º 2
0
 public BrandsController(IProductStorage productStorage,
                         IMapper mapper,
                         IApiStatusMessageDictionary statusMessageDictionary)
     : base(statusMessageDictionary)
 {
     _productStorage = productStorage;
     _mapper         = mapper;
 }
Exemplo n.º 3
0
        public MainPage()
        {
            InitializeComponent();

            storage = new JsonStorage("productlistf");
            cl      = storage.Load();
            clvm    = new CategoryListViewModel(cl);

            BindingContext = clvm;

            UpdateListContent();
        }
Exemplo n.º 4
0
 public ProductTransactionService(IProductStorage productStorage,
                                  IProductTransactionStorage productTransactionStorage,
                                  IMapper mapper,
                                  IUserStorage userStorage,
                                  IDbTransactionService transactionService)
 {
     _productStorage            = productStorage;
     _productTransactionStorage = productTransactionStorage;
     _mapper               = mapper;
     _userStorage          = userStorage;
     _dbTransactionService = transactionService;
 }
Exemplo n.º 5
0
        /// <summary>
        /// Éditer un produit déjà présent dans la liste de produits
        /// </summary>
        /// <param name="p">Le vue/modèle du produit à modifer</param>
        /// <param name="storage">Le stockage à utiliser</param>
        /// <param name="clvm">La liste de catégories</param>
        /// <param name="cvm">La catégorie à laquelle ajouter le produit</param>
        public EditPage(ProductViewModel p, IProductStorage storage, CategoryListViewModel clvm, CategoryViewModel cvm = null)
        {
            InitializeComponent();

            this.p         = p;
            BindingContext = this.p;
            this.storage   = storage;
            this.clvm      = clvm;

            listCat.ItemsSource  = clvm.Categories;
            listCat.SelectedItem = p.Category;

            if (cvm != null)
            {
                this.cvm = cvm;
            }
        }
 public NewProductSagaHandler()
 {
     this.productStorage = Bootstrapper.Container.Resolve <IProductStorage>();
 }
 public ProductService(IProductStorage productStorage, IMapper mapper)
 {
     _productStorage = productStorage;
     _mapper         = mapper;
 }
Exemplo n.º 8
0
 public ProductRepository(IProductStorage productStorage)
 {
     _productStorage = productStorage;
 }
Exemplo n.º 9
0
 public ProductService(IProductStorage productStorage)
 {
     _productStorage = productStorage;
 }
Exemplo n.º 10
0
 public ProductController(IProductStorage _storage)
 {
     this.storage = _storage;
 }
Exemplo n.º 11
0
 public ProductBusinessLogic(IProductStorage productStorage)
 {
     _productStorage = productStorage;
 }
Exemplo n.º 12
0
 public AdministratorsOnlyStorageProxy(IProductStorage inner)
 {
     _inner = inner;
 }
 public ProductsCatalog(IProductStorage productStorage)
 {
     this.productStorage = productStorage;
 }
Exemplo n.º 14
0
 public TravelLogic(IProductStorage travelStorage)
 {
     _travelStorage = travelStorage;
 }
Exemplo n.º 15
0
 public CachingProductStorage(IProductStorage inner)
 {
     _inner = inner;
     _cache = new MemoryCache(new MemoryCacheOptions());
 }
 public OrderStorage(IOptions <StorageOptions> storageOptions, IProductStorage productStorage)
 {
     _connection     = new SqlConnection(storageOptions.Value.DBConnectionString);
     _productStorage = productStorage;
 }
Exemplo n.º 17
0
 public ProductPopulateService(IProductStorage productStorage)
 {
     _productStorage = productStorage;
     WarmUpService();
 }