LINQ to Entities 不支持 LINQ 表达式节点类型“Invoke”
2016-12-17 09:24
288 查看
/// <summary>
/// 实体查询
/// </summary>
public IEnumerable<TEntity> GetSearchList(System.Linq.Expressions.Expression<Func<TEntity, bool>> where)
{
if (where == null)
return this._db.Set<TEntity>().AsExpandable();//.AsExpandable();
return this._db.Set<TEntity>().AsExpandable().Where(where);
}
//解决问题:Where() 之前先用 AsExpandable()//
/// 实体查询
/// </summary>
public IEnumerable<TEntity> GetSearchList(System.Linq.Expressions.Expression<Func<TEntity, bool>> where)
{
if (where == null)
return this._db.Set<TEntity>().AsExpandable();//.AsExpandable();
//这个最重要.否则会出如题的错误.
return this._db.Set<TEntity>().AsExpandable().Where(where);
}
//解决问题:Where() 之前先用 AsExpandable()//
这个最重要.否则会出如题的错误.
相关文章推荐
- LINQ to Entities 不支持 LINQ 表达式节点类型“Invoke”
- LINQ to Entities 不支持 LINQ 表达式节点类型“Invoke”(笔记)
- 解决 LINQ to Entities 不支持 LINQ 表达式节点类型“Invoke”
- LINQ to Entities 不支持 LINQ 表达式节点类型“Invoke”
- LINQ to Entities 不支持 LINQ 表达式节点类型“ArrayIndex”
- 无法将类型“System.Nullable`1”强制转换为类型“System.Object”。LINQ to Entities 仅支持强制转换 EDM 基元或枚举类型。
- dhl:报错:LINQ to Entities 不支持指定的类型成员“Date”
- LINQ to Entities 不支持指定的类型成员“ReviewRemainDays”。只支持初始值设定项、实体成员和实体导航属性
- Lambda表达式--使用方法语法的复杂查询: join (在单个 LINQ to Entities 查询中的两个结构上不兼容的初始化过程中出现类型)
- LINQ to Entities 不支持指定的类型成员
- 在 LINQ to Entities 查询中无法构造实体或复杂类型
- LINQ to Entities 不识别方法"System.String ToString()",因此该方法无法转换为存储表达式 的解决方法
- 让Sqlite完美支持linq to entities
- LINQ to Entities 不识别方法“System.String ToString()”,因此该方法无法转换为存储表达式。
- 在LINQ to Entities 中,使用lambada或linq时, 变量类型需提前转换
- 提交了 VS 2008 sp1 对 Linq to SQL 的 xml 字段类型支持的一个 bug
- Linq to Entities中无法构造实体或复杂类型
- LINQ to Entities不识别方法***,因此该方法无法转换为存储表达式
- LinQ to entities 不能识别方法“system.string.ToString(system.String)”.因此该方法无法转换为存储表达式
- Linq中字段数据类型转换问题(Linq to entity,LINQ to Entities 不识别方法"System.String ToString()"问题解决)