实体核心异常:必须是可简化的节点

时间:2017-02-24 17:12:03

标签: c# entity-framework entity-framework-core

当我尝试“连接”使用导航属性的多个IQueryable子句时,我在Entity Core 1.1.0中遇到异常。

简单示例(不是我的实际代码):

var testUsers = _context.Users.AsNoTracking().Include(a => a.Company)
            .Where(a => a.Company != null && !string.IsNullOrEmpty(a.Company.Name) && a.Company.Name.Contains("E"));

testUsers = testUsers
            .Where(a => a.Company != null && !string.IsNullOrEmpty(a.Company.Name) && a.Company.Name.Contains("D"));

testUsers.ToList(); //Exception Message: must be reducible node 

堆栈追踪:

at System.Linq.Expressions.Expression.ReduceAndCheck()
at System.Linq.Expressions.Expression.ReduceExtensions()
at System.Linq.Expressions.Compiler.StackSpiller.RewriteExtensionExpression(Expression expr, Stack stack)
....

好像是一个bug?或者我做错了什么?

0 个答案:

没有答案