您的位置:首页 > 其它

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()//
这个最重要.否则会出如题的错误.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐