0

非常に単純なクエリと思われるものを書きました。

public IList<Departement> GetDepartements()  
{
    IQueryable<MyContext> queryBase = QueryBase();

    IQueryable<Departement> query = 
        (from x in queryBase
         group x by x.Geographies.DepartementCode
         into grp
         select new Departement
             {
                 code = grp.Key,
                 numberOfDistributors =
                     grp.Select(x=> x.Distributors.Distributeur_PK)
                        .Count(),
                 numberOfLeads =
                     grp.Select(x=> x.Leads.DemandeWeb_FK).Count()
             }
        );
    return query.ToList();
}

残念ながら、接続タイムアウト エラーが発生します。

このような単純なクエリには必要ないと思うので、DataContext.CommandTimeout プロパティを変更したくありません。

このエラーが発生する理由は何ですか?

4

1 に答える 1