将Linq结果字段设置为等于集合

时间:2017-02-21 16:14:27

标签: c# linq

是否可以将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"),
            });

0 个答案:

没有答案