public static IEnumerable<(string customerId, int orderId, DateTime orderDate)> Res() { List<Customer> customers = Customers.CustomerList; string region = "WA"; IEnumerable<(string, int, DateTime)> res = (from c in customers from o in c.Orders where c.Region == region select (c.CustomerId, o.OrderId, o.OrderDate)).Take(3); return res; }
IEnumerable<(string, int, DateTime)> res = customers .Where(c => c.Region == region) .SelectMany(c => c.Orders.Select(o => (c.CustomerId, o.OrderId, o.OrderDate))) .Take(3);
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)