2017-04-24 85 views
0

就像你在我的图片中看到的,我在桌子上有一张桌子,我该如何解决这个问题?LINQPad 4中的C#表中的表格

Picture

我这样做,用C#语句。

var testGR = (from doc in DocumentTypes select new { doc.PIMID, documentTypeLabel = from docLabel in doc.DocumentTypeLabels select new {docLabel.Name}}); testGR.Dump(); 

如何更改我的代码以获得像图片中的结果?

回答

0

这听起来像你想的:

var testGR = 
    from doc in DocumentTypes 
    select new 
    { 
    doc.PIMID, 
    documentTypeLabel = doc.DocumentTypeLabels.FirstOrDefault (l => l.Name) 
    }; 

testGR.Dump();