Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/linq/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# LINQ查询返回列表的列表_C#_Linq_Linq To Sql - Fatal编程技术网

C# LINQ查询返回列表的列表

C# LINQ查询返回列表的列表,c#,linq,linq-to-sql,C#,Linq,Linq To Sql,我有一个问题: from m in dc.ReportingMonths where m.Month.Value == month select (from k in m.KPI_Actives where k.DateActive.Year == year select (from r in dc.ReportingViews where r.KPIID == k.KPIID select r) ); 显然,因为它

我有一个问题:

from m in dc.ReportingMonths
where m.Month.Value == month
select (from k in m.KPI_Actives
        where k.DateActive.Year == year
        select (from r in dc.ReportingViews
                where r.KPIID == k.KPIID select r)
       );
显然,因为它是嵌套的LINQ查询——每个查询返回一个iQueryTable,所以我得到了一组iQueryTables

如何编写一个类似的查询,只返回一个简单的ReportingView列表作为最后一个查询的返回,而不使用foreach循环创建一个新列表

谢谢

类似于:

from m in dc.ReportingMonths where m.Month.Value == month
from k in m.KPI_Actives
where k.DateActive.Year == year
from r in dc.ReportingViews
where r.KPIID == k.KPIID
select r;

类似于:

from m in dc.ReportingMonths where m.Month.Value == month
from k in m.KPI_Actives
where k.DateActive.Year == year
from r in dc.ReportingViews
where r.KPIID == k.KPIID
select r;

谢谢!没有意识到我可以做到这一点,没有选择的声明在每一点。谢谢!我不知道如果没有select语句,我可以做到这一点。