예제 #1
0
 public ProductService(IProductLoader loader)
 {
     _loader     = loader;
     _itemsAsync = new AsyncLazy <List <Product> >(async() => await _loader.LoadProducts());
 }
예제 #2
0
 public ProductProvider(IProductLoader loader)
 {
     Loader = loader;
 }
예제 #3
0
 public InputValidator(IProductLoader loader)
 {
     _loader = loader;
 }
예제 #4
0
 public Shop()
 {
     _productLoader    = new ProductLoader(); //TODO replace with DI
     _orderLoader      = new OrderLoader();
     _receiptGenerator = new ReceiptGenerator();
 }
예제 #5
0
 public ProductService(IProductLoader loader)
 {
     _loader = loader;
     _itemsAsync = new AsyncLazy<List<Product>>(async () => await _loader.LoadProducts());
 }
예제 #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());
 }