Skip to content

Include and ThenInclude sub properties causes System.InvalidOperationException: Operations that change non-concurrent collections must have exclusive access. A concurrent update was performed on this collection and corrupted its state. The collection's state is no longer correct #12926

@RussKeldorph

Description

@RussKeldorph

From @harsha89vyas on July 19, 2018 15:54

The following include sequence causes the System.InvalidOperationException: Operations that change non-concurrent collections must have exclusive access. A concurrent update was performed on this collection and corrupted its state. The collection's state is no longer correct
.Include(x => x.A)
.ThenInclude(x => x.B)
.ThenInclude(x => x.C)
.Include(x => x.A)
.ThenInclude(x => x.B)
.ThenInclude(x => x.D)
.ThenInclude(x => x.E)
.Include(x => x.A)
.ThenInclude(x => x.B)
.ThenInclude(x => x.D)
.ThenInclude(a => a.F)
.Include(x => x.A)
.ThenInclude(x => x.B)
.ThenInclude(x => x.D)
.ThenInclude(a => a.G)
.Include(x => x.A)
.ThenInclude(x => x.B)
.ThenInclude(x => x.D)
.ThenInclude(a => a.C)
.ThenInclude(a => a.H)

This happens due to the fix dotnet/coreclr#16991 applied due to issue https://github.com/dotnet/corefx/issues/28123

Copied from original issue: dotnet/coreclr#19027

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    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