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

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

posted @ 2016-12-17 13:32  阿Q啊  阅读(1508)  评论(1编辑  收藏  举报