Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use the correct MemberInfo for collection include #16287

Closed
AndriySvyryd opened this issue Jun 26, 2019 · 2 comments · Fixed by #16796
Closed

Use the correct MemberInfo for collection include #16287

AndriySvyryd opened this issue Jun 26, 2019 · 2 comments · Fixed by #16796
Labels
closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. type-bug
Milestone

Comments

@AndriySvyryd
Copy link
Member

AndriySvyryd commented Jun 26, 2019

Usually this should be navigation.GetMemberInfo(forConstruction: true, forSet: true)

@smitpatel
Copy link
Contributor

@AndriySvyryd - How should I construct my model to add a regression test for this? Is this only applicable to collection include (as opposed to naked collection navigation projection)?

@AndriySvyryd
Copy link
Member Author

AndriySvyryd commented Jul 1, 2019

Something like

modelbuilder.Entity<CoolEntity>().SetNavigationAccessMode(PropertyAccessMode.Field);
private class CoolEntity
{
    private ICollection<CoolEntity> _otherEntities;

    public int Id { get; set;}
    public ICollection<CoolEntity> OtherEntities
    {
        get => _otherEntities;
        set => throw new InvalidOperationException();
    }
}

This applies to all collections populated directly from query.

@ajcvickers ajcvickers modified the milestones: 3.0.0, 3.0.0-preview7 Jul 2, 2019
@ajcvickers ajcvickers assigned ajcvickers and unassigned smitpatel Jul 24, 2019
ajcvickers added a commit that referenced this issue Jul 28, 2019
Fixes #16287

Ended up being quite a can of worms--cleaned up some CLR accessor code that is no longer being used (it was there for old pipeline) and found several additional bugs in the same area.
@ajcvickers ajcvickers added the closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. label Jul 28, 2019
ajcvickers added a commit that referenced this issue Jul 28, 2019
Fixes #16287

Ended up being quite a can of worms--cleaned up some CLR accessor code that is no longer being used (it was there for old pipeline) and found several additional bugs in the same area.
ajcvickers added a commit that referenced this issue Jul 28, 2019
Fixes #16287

Ended up being quite a can of worms--cleaned up some CLR accessor code that is no longer being used (it was there for old pipeline) and found several additional bugs in the same area.
@ajcvickers ajcvickers modified the milestones: 3.0.0, 3.0.0-preview8 Jul 29, 2019
@ajcvickers ajcvickers modified the milestones: 3.0.0-preview8, 3.0.0 Nov 11, 2019
@ajcvickers ajcvickers removed their assignment Sep 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. type-bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants