码迷,mamicode.com
首页 > 其他好文 > 详细

LINQ to Entities 不支持 LINQ 表达式节点类型“Invoke”

时间:2016-12-17 16:17:46      阅读:242      评论:0      收藏:0      [点我收藏+]

标签:system   span   expr   this   实体   and   null   back   search   

        /// <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()//这个最重要.否则会出如题的错误.

LINQ to Entities 不支持 LINQ 表达式节点类型“Invoke”

标签:system   span   expr   this   实体   and   null   back   search   

原文地址:http://www.cnblogs.com/ln-qiqi/p/6189568.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!