是否可以将Linq结果中的字段设置为集合? 例如:
var fileResult = myCollection.GroupBy(x => new { x.FileId, x.SourceFileName })
.Select(x => new OutputEntity()
{
FileId = x.Key.FileId,
SourceFileName = x.Key.SourceFileName,
Batches = List<Batch>I want to add a list of Batch objects here,
ScannedBatchCount = x.Count(y => y.BatchType == "S"),
});