Exemplo n.º 1
0
 public OrderItem CreateItem(Order order, Product product)
 {
     var orderItem = new OrderItem
     {
         Order = order,
         Price = 1,
         Product = product,
         Quantity = 3,
         Store = "Internet"
     };
     //_generator.Context.OrderItems.InsertOnSubmit(orderItem);
     _generator.EntityDeleteActions.Add(context => context.OrderItems.DeleteOnSubmit(orderItem));
     return orderItem;
 }
Exemplo n.º 2
0
 partial void DeleteOrder(Order instance);
Exemplo n.º 3
0
 partial void UpdateOrder(Order instance);
Exemplo n.º 4
0
 partial void InsertOrder(Order instance);
Exemplo n.º 5
0
		private void detach_Orders(Order entity)
		{
			this.SendPropertyChanging();
			entity.Customer = null;
		}
Exemplo n.º 6
0
		private void attach_Orders(Order entity)
		{
			this.SendPropertyChanging();
			entity.Customer = this;
		}
Exemplo n.º 7
0
 public Order CreateOrderForCustomer(Customer customer)
 {
     var order = new Order
     {
         Customer = customer,
         OrderDate = DateTime.Now.AddDays(-5),
         ShipDate = DateTime.Now.AddDays(5)
     };
     _generator.Context.Orders.InsertOnSubmit(order);
     _generator.EntityDeleteActions.Add(context => context.Orders.DeleteOnSubmit(order));
     return order;
 }
Exemplo n.º 8
0
 public Order[] CreateOrdersForCustomers(params Customer[] customers)
 {
     var orders = new Order[customers.Length];
     for (var i = 0; i < customers.Length; i++)
         orders[i] = CreateOrderForCustomer(customers[i]);
     return orders;
 }