I have a LINQ query that uses tuples for optimization. However, I'm unable to find working syntax to unpack the tuple in the arguments, which seems surprising because C# does support unpacking tuples and other languages supporting lambdas and tuples do support unpacking.
Is there any way to leverage unpacking in the expression below instead of referencing properties of the full tuple?
shelves
.Select(kv => (kv.Key, kv.Value.Orders.Count))
.Where(tuple => tuple.Count > 0)
.OrderBy(tuple => tuple.Count)
.Select(tuple => tuple.Key);
.Select(i => (i.Key, i.Count)).Select((key, count) => ....)
- No, not implicit deconstruction into lambda parameters. – Wolof