I'd like to use parameter "o" (the source object) in the result of grouping, as so:
return (from o in objects
group o by MySpecialConverter(o) into g
select new Group
{
Key = g.Key,
Items = g.ToList(),
Source = o, // Error: The name 'o' does not exist in the current context.
...
}).ToList();
However, I am not able to access "o" in the new group.
Use the grouped element rather than using the used element in group statement.
Or if you want to get any number of element or first element or last element you can use the let key word.