Esempio n. 1
0
 public ProductService(IProductLoader loader)
 {
     _loader     = loader;
     _itemsAsync = new AsyncLazy <List <Product> >(async() => await _loader.LoadProducts());
 }
Esempio n. 2
0
 public ProductProvider(IProductLoader loader)
 {
     Loader = loader;
 }
 public InputValidator(IProductLoader loader)
 {
     _loader = loader;
 }
Esempio n. 4
0
 public Shop()
 {
     _productLoader    = new ProductLoader(); //TODO replace with DI
     _orderLoader      = new OrderLoader();
     _receiptGenerator = new ReceiptGenerator();
 }
Esempio n. 5
0
 public ProductService(IProductLoader loader)
 {
     _loader = loader;
     _itemsAsync = new AsyncLazy<List<Product>>(async () => await _loader.LoadProducts());
 }
Esempio n. 6
0
 /// <summary>
 /// Converts a productlist from one format to another
 /// </summary>
 /// <param name="from"> Source list </param>
 /// <param name="to"> Destination list</param>
 private static void TransferProductList(IProductLoader from, IProductLoader to)
 {
     to.SaveProducts(from.LoadProducts());
 }