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; }
private void detach_OrderItems(OrderItem entity) { this.SendPropertyChanging(); entity.Product = null; }
private void attach_OrderItems(OrderItem entity) { this.SendPropertyChanging(); entity.Product = this; }
partial void DeleteOrderItem(OrderItem instance);
partial void UpdateOrderItem(OrderItem instance);
partial void InsertOrderItem(OrderItem instance);