Home > other >  How to resolve StackOverflow/AccessViolation Exception in Entity Framework with enormous entity >
How to resolve StackOverflow/AccessViolation Exception in Entity Framework with enormous entity >

Time:07-25

We have an enormous entity with 811 properties.

We generate views dynamically at runtime, which completes successfully.

We are testing by a simple query for all records all columns.

From trial and error we discovered if the property count is less than 775, the query returns no problem. If >= 755 it causes either an AccessViolation exception or StackOverflow Exception, like:

An unhandled exception of type 'System.StackOverflowException' occurred in Microsoft.EntityFramework.dll

It seems we have hit a ceiling for entity size. Because the exception appears to be from within EntityFramework core, it's hard to debug further.

Is this a known limitation and is there anything we can do to work around it?

Exception details: Exception details

EDIT

The underlying database is SQL, and here is the query (column names redacted as this is company internals)

[18:18:06 INF] Executed DbCommand (112ms) [Parameters=[@__TypedProperty_1='?' (DbType = Int32), @__TypedProperty_0='?' (DbType = Int32)], CommandType='"Text"', CommandTimeout='30']
SELECT TOP(@__TypedProperty_1) [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...], [t].[column_...]
FROM (
    SELECT TOP(@__TypedProperty_0) [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...], [p].[column_...]
    FROM [dbo].[table_...] AS [p]
    ORDER BY [p].[column_...]
) AS [t]
ORDER BY [t].[column_...]
An unhandled exception of type 'System.StackOverflowException' occurred in Microsoft.EntityFrameworkCore.dll

CodePudding user response:

I resolved the issue by turning off change tracking in our DbContext.

protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
    if (!optionsBuilder.IsConfigured)
    {
        optionsBuilder
            ...
            .UseQueryTrackingBehavior(QueryTrackingBehavior.NoTracking);
    }
}

Our endpoint is intended to be readonly anyway.

  • Related