c#LINQ to Entities无法识别方法'Boolean [英] c# LINQ to Entities does not recognize the method 'Boolean
问题描述
推荐答案
可能此查询应该在SQL Server上执行,您的代码定义
IsConnectionValid 不可用。
提供有关此函数的详细信息,并考虑将其替换为可在SQL中执行的表达式。如果这是不可能的,那么执行
尚未计算 OnLine 的查询,将在稍后计算,如下所示:
Give details about this function and consider replacing it with some expression that can be executed in SQL. If this is not possible, then execute a query that does not yet calculate OnLine, wich will be calculated later, something like this:
foreach(var i in(来自db.Color中的a
;
加入我的db.ColorClothes
;   上a.InstallationId
跨度>等于i.InstallationId
的    &NBSP ;
其中a.Id == Id
       
跨度>选择
的    &NBSP ; &n BSP;  
new
                
{
                 
ID = i.id,
                       
InstallationId = i.InstallationId
              
})
                
.ToList()
            
。选择(z =>
  ;
new
{
ID = z.ID,
OnLine = Utilities.IsConnectionValid(z.InstallationId)
的            
跨度>})
                 
))
foreach( var i in ( from a in db.Color
join i in db.ColorClothes
on a.InstallationId equals i.InstallationId
where a.Id == Id
select
new
{
ID = i.id,
InstallationId = i.InstallationId
} )
.ToList()
.Select( z =>
new
{
ID = z.ID,
OnLine = Utilities.IsConnectionValid(z.InstallationId)
} )
) )
这篇关于c#LINQ to Entities无法识别方法'Boolean的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!