예제 #1
0
        public void AddLineToOrder()
        {
            var context  = new AwesomeStoreContext();
            var customer = context.Customers.FirstOrDefault();
            var order    = new Order(customer);
            var line     = order.AddLine(10, 1);

            context.Orders.Add(order);
            context.OrderLines.Add(line);
            context.SaveChanges();
        }
예제 #2
0
 public int SaveChanges()
 {
     return(_context.SaveChanges());
 }