score:2

Accepted answer

I found a solution via linq provider. You have to project the grouped Items explicitly via Select() and property by property on the group result, e.g.:

var groupedItems = _collection
    .AsQueryable()
    .GroupBy(pv => pv.ArticleNumber, (key, group) => new
    {
        key,
        Items = group.Select(groupItem => new ProductVersion { PropertyA = groupItem.PropertyA, ... })
    })
...

Related Articles