Repository navigation
Closed
Copy link
Milestone
Description
query using Northwind model:
from e in ctx.Employees.Where(c => c.EmployeeID == NonExistentID).DefaultIfEmpty()
select "Foo";query plan:
(QueryContext queryContext) => IEnumerable<string> _InterceptExceptions(
|__ source: IEnumerable<string> DefaultIfEmpty(IEnumerable<string> _DefaultIfEmptyShapedQuery(
| |__ queryContext: queryContext,
| |__ shaperCommandContext: SelectExpression:
| | SELECT 1
| | FROM (
| | SELECT NULL AS [empty]
| | ) AS [empty]
| | LEFT JOIN (
| | SELECT [c].*
| | FROM [Employees] AS [c]
| | WHERE [c].[EmployeeID] = -1
| | ) AS [t] ON 1 = 1,
| |__ shaper: (QueryContext queryContext | ValueBuffer c) => "Foo")),
|__ contextType: TestModels.Northwind.NorthwindRelationalContext,
|__ logger: DiagnosticsLogger<Query>,
|__ queryContext: Unhandled parameter: queryContext)
Exception:
System.NullReferenceException : Object reference not set to an instance of an object.
at Microsoft.EntityFrameworkCore.Storage.ValueBuffer.get_Count()
at Microsoft.EntityFrameworkCore.Query.QueryMethodProvider.<_DefaultIfEmptyShapedQuery>d__11`1.MoveNext()
at System.Linq.Enumerable.<DefaultIfEmptyIterator>d__93`1.MoveNext()
at Microsoft.EntityFrameworkCore.Query.Internal.LinqOperatorProvider.ExceptionInterceptor`1.EnumeratorExceptionInterceptor.MoveNext()
at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
at Microsoft.EntityFrameworkCore.Query.SimpleQueryTestBase`1.Default_if_empty_top_level(Boolean isAsync)
at Microsoft.EntityFrameworkCore.Query.SimpleQuerySqlServerTest.<>n__7(Boolean isAsync)
at Microsoft.EntityFrameworkCore.Query.SimpleQuerySqlServerTest.<Default_if_empty_top_level>d__14.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
Activity
smitpatel commentedon Nov 16, 2018
ValueBuffer did not have any values! 🤦♂️
2 remaining items
Relational: Translate SelectMany
Relational: Translate SelectMany
Relational: Translate SelectMany
Relational: Translate SelectMany