Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/274.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# LINQ to实体无法识别方法';Double(System.String,System.String)和#x27;方法 localpreferences\u local=newlocalpreferences(); SES1 SES1=新的SES_C#_Linq_Linq To Entities - Fatal编程技术网

C# LINQ to实体无法识别方法';Double(System.String,System.String)和#x27;方法 localpreferences\u local=newlocalpreferences(); SES1 SES1=新的SES

C# LINQ to实体无法识别方法';Double(System.String,System.String)和#x27;方法 localpreferences\u local=newlocalpreferences(); SES1 SES1=新的SES,c#,linq,linq-to-entities,C#,Linq,Linq To Entities,LINQ to实体无法识别方法';Double(System.String,System.String)和#x27;方法 localpreferences\u local=newlocalpreferences(); SES1 SES1=新的SES1(); var先例=在_local.prevention u案例中的p_ 其中ses1.FindSES1(query.ToLower(),p.query.ToLower())

LINQ to实体无法识别方法';Double(System.String,System.String)和#x27;方法
localpreferences\u local=newlocalpreferences();
SES1 SES1=新的SES1();
var先例=在_local.prevention u案例中的p_
其中ses1.FindSES1(query.ToLower(),p.query.ToLower())<80
选择p;

if(prevention.Count()哪一行给出了这个错误?here-if(prevention.Count()错误。It here
finds1(query.ToLower(),p.query.ToLower())
Hi Aron.真的吗?需要更正吗?请如何更正?谢谢。您不能。SES不是SQL Server中存在的类。您必须将其作为LinqToObjects查询运行。这意味着下载整个表。只需将
\u local.prevention\u case\u
替换为
\u local.prevention\u case\u.AsEnumerable()
  LocalPrecedentEntities _local = new LocalPrecedentEntities();
            SES1 ses1 = new SES1();
            var precedent =  from p in _local.Precedent__case_
                             where ses1.FindSES1(query.ToLower(), p.Query.ToLower()) < 80
                             select p;
            if (precedent.Count() <= 0)
            {
                var iSites = this.getSitesFromDB(query, queryType);
                return iSites;
            }
            else
            {
                var sites = new List<string>();
            foreach (var p in precedent)
            {

                var pSite = from r in _local.Result
                            where r.ResultId == p.ResultId
                            select r.SiteId;
                sites.AddRange(pSite);
            }