使用方法语法查询EF Graph

时间:2015-05-06 20:15:03

标签: c# entity-framework

我有一个实体图,我从要查询的数据层返回,因此集合将显示在gridview中(我尝试展平图形)。如何使用方法语法执行此操作?

我对使用集合展平实体图的任何更好的方法或最佳实践感兴趣。

// schedule is entity graph and days is a child collection in the graph
    var gridView = from s in schedule
                   from b in s.days
                   select new
                   {
                       id = s.Id,
                       custnum = s.CustNum,
                       days = b.Days
                   }
    dataGridView1 = gridView.ToList();

0 个答案:

没有答案
相关问题