Skip to content

Json and ComplexProperty and nested collection exception : Complex entry original ordinal ''-1'' is invalid for property ... as it''s outside of the collection of length ''0''. #38566

Description

@vborioni-onit

Bug description

Hi,
here is the repro of the issue, the exception message calling DetectChanges() is :
"Complex entry original ordinal ''-1'' is invalid for property ... as it''s outside of the collection of length ''0''."

Your code

Here is a minimal repro project, it happens no matter the provider that support Json (tested on SqlServer and SqlLite)

https://github.com/vborioni-onit/ef10_json_ComplexProperty_nested_collection_bug

Stack traces


Verbose output


EF Core version

10.0.9

Database provider

No response

Target framework

.NET10

Operating system

Windows 11

IDE

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions