Esempio n. 1
0
        public void OrderPart(PartType part, int count)
        {
            var order = new Order()
            {
                PartTypeId = part.Id,
                PartCount  = count,
                PlacedDate = DateTime.Now
            };

            order.Part       = context.Parts.Single(p => p.Id == order.PartTypeId);
            order.Supplier   = context.Suppliers.First(s => s.PartTypeId == part.Id);
            order.SupplierId = order.Supplier.Id;
            context.CreateOrder(order);
        }