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

正在创建模型,此时不可使用上下文“的解决办法
原文地址:https://www.cnblogs.com/ln-qiqi/p/6189568.html