0

我有以下代码试图完成查询以填充数据列表。我需要加入他们,但我找不到遵循我正在使用的语法样式的实体空间文档,我正在尝试尽可能少地更改/重写此代码。请帮我完成查询。

让我们说,表 estimtes 联系人字段 id 承包商也包含,我想加入它,这就是我到目前为止所拥有的:

Estimates resest = new Estimates();


        Contractors cons = new Contractors();

        cons.Query.LoadDataTable();


        DataList dl = (DataList)pn90day.FindControl("dlpreapprovalestimates");



        resest.Query.Where(resest.Query.FDDKey.Equal(FDDkey));
        resest.Query.InnerJoin(
4

2 回答 2

2
EstimatesQuery eq = new EstimatesQuery("es");
ContractorsQuery cq = new ContractorsQuery("co");

eq.Where(eq.FDDKey == FDDkey);
eq.InnerJoin(cq).On(eq.Contractorky == cq.Contractorky);

EstimatesCollection coll = new EstimatesCollection();
if(coll.Load(eq))
{
    // Then we have found at least one
}

我是EntitySpaces的作者

于 2015-10-26T18:00:21.780 回答
0

估计restest = new Estimates();

        Contractors cons = new Contractors();

        EstimatesQuery est = new EstimatesQuery("es");
        ContractorsQuery cont = new ContractorsQuery("co");

        //cons.Query.LoadDataTable();


        DataList dl = (DataList)pn90day.FindControl("dlpreapprovalestimates");


        est.Where(est.FDDKey.Equal(FDDkey));

        est.InnerJoin(cont).On(est.Contractorky == cont.Contractorky);
于 2015-05-12T15:26:05.673 回答