当我尝试“连接”使用导航属性的多个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?或者我做错了什么?