EF查询花费太多时间和结果导致超时异常

时间:2018-09-03 07:44:51

标签: entity-framework linq

我正在使用LINQ查询从表中搜索字符串,一段时间后导致超时异常。请帮助我简化如下查询。

var lstEntityMasterdata1 = (from E in _contextRegister.Entities
                            join ba in _contextRegister.BusinessActivities on E.MainActivityId equals ba.Id into NewBA
                            from BA in NewBA.DefaultIfEmpty()
                            where (E.NameOfEstablishment.Contains(SearchKey) || E.LicenseNr.Contains(SearchKey))
                            && (E.IsDeleted != true && E.Active != false)
                            select new { E, BA }).ToList();

0 个答案:

没有答案