public static Order CreateOrder() { Product p1 = new Product { ID = 1, Description = "p2", Price = 9 }; Product p2 = new Product { ID = 2, Description = "p3", Price = 6 }; Order order = new VIPOrder() { ID = 4, Description = "Order for John Doe. Use the nice giftwrap", IsDirty = true, // will be false when deserializing (ignored XML property) OrderLines = new List <OrderLine> { new OrderLine { ID = 5, Amount = 1, Product = p1 }, new OrderLine { ID = 6, Amount = 10, Product = p2 } } }; return(order); }
public static Order CreateOrder() { Product p1 = new Product { ID = 1, Description = "p2", Price = 9 }; Product p2 = new Product { ID = 2, Description = "p3", Price = 6 }; Order order = new VIPOrder() { ID = 4, Description = "Order for John Doe. Use the nice giftwrap", OrderLines = new List <OrderLine> { new OrderLine { ID = 5, Amount = 1, Product = p1 }, new OrderLine { ID = 6, Amount = 10, Product = p2 } } }; return(order); }
public static Order CreateOrder() { Product p1 = new Product { ID = 1, Description = "p2", Price = 9 }; Product p2 = new Product { ID = 2, Description = "p3", Price = 6 }; Order order = new VIPOrder() { ID = 4, Description = "Order for John Doe. Use the nice giftwrap", IsDirty = true, // will be false when deserializing (ignored XML property) OrderLines = new List<OrderLine> { new OrderLine { ID = 5, Amount = 1, Product = p1 }, new OrderLine { ID = 6, Amount = 10, Product = p2 } } }; return order; }