public DepotTransaction(Trader trader, MarketProduct marketProduct, int amountPieces) { Depot = trader.Depot; DepotId = trader.Depot.Id; Product = marketProduct.Product; ProductCode = marketProduct.Product.Code; Amount = amountPieces; Price = marketProduct.Price; Time = DateTime.UtcNow; }
public BookingOrder(Trader trader, MarketProduct marketProduct, int amount, decimal threshold) { Trader = trader; TraderId = trader.Id; MarketProduct = marketProduct; ProductCode = marketProduct.ProductCode; Amount = amount; Threshold = threshold; Booked = false; }
public void AddMarketProduct(MarketProduct marketProduct) { context.Market.Add(marketProduct); context.Products.Add(marketProduct.Product); context.SaveChanges(); }