Exemplo n.º 1
0
 public byte[] GetFile(IEnumerable <ProductVariant> variants)
 {
     return(_csvFileWriter.GetFile(variants.Where(variant => variant.Product.Published),
                                   new Dictionary <string, Func <ProductVariant, object> >
     {
         { "Name", variant => variant.FullName },
         { "SKU", variant => variant.SKU },
         { "Stock Remaining", variant => _getStockRemainingQuantity.Get(variant) }
     }));
 }
        public byte[] GetFile(IList <WarehouseStock> items)
        {
            var sortedDictionary = new Dictionary <string, Func <WarehouseStock, object> >
            {
                { "Name", stock => stock.ProductVariantName },
                { "SKU", stock => stock.ProductVariantSKU },
                { "Warehouse", stock => stock.Warehouse.Id },
                { "Stock Remaining", stock => stock.StockLevel }
            };

            return(_csvFileWriter.GetFile(items, sortedDictionary));
        }