public static void TestGetCs2(Order o) { var values = GetCs(o.OrderDetails); foreach (var c in values) { var test = c.Id; var test2 = c.OrderDetail.Quantity; } foreach (var _ in values.Select(c => c.OrderDetail.Order)) ; }
public static void TestGetCs(Order o) { foreach (var c in GetCs(o.OrderDetails)) { var test = c.Id; var test2 = c.OrderDetail.Quantity; } }
public static IEnumerable<Order> GetCustomer(Order o) { if (o == null) return null; return o.Customer.Orders.Where(o2 => o2.Id > 10); }
public static void TestGetC2(Order o) { var test = GetC2(o.Customer, o).OrderDetail.UnitPrice; }
public static C GetC2(this Customer c, Order o) { if (c.Id > 10) return new C { Id = c.Id, OrderId = o.Id, OrderDetail = c.Orders.First().OrderDetails.First() }; return new C { Id = c.Id, OrderId = c.Orders2.First().Id, OrderDetail = c.Orders2.First().OrderDetails.First() }; }