wpf gridcontrol 绑定到 linq to ef 查询很慢

wpf gridcontrol bindint to liq to ef query is slow

我在 wpf 中有一个用户控件,其中包含一个网格控件 我已经将 gridcontrol 数据源设置为 linq to ef join 查询,如下所示:

var x = from B in x.B join E in X.E on B.E_ID equals E.E_ID
        select B
gridcontrol.datasource = x.tolist();

在 xaml 代码中,我将网格控制列设置为:

第一列FieldName = ID

第二列FieldName = E.Name

由于第二列绑定到 E table,gridcontrol 加载非常慢

请给我一个提高速度的解决方案

非常感谢 lvan Stoev 正如 he/she 所说,我更改了我的查询 usefull.now 加载用户控件只需要 8 秒。 查询: db.b.include("E").tolist()