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

Reverse engineering: Navigation properties should not be virtual by default #6326

Closed
bricelam opened this issue Aug 15, 2016 · 5 comments
Closed
Assignees
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

@bricelam
Copy link
Contributor

bricelam commented Aug 15, 2016

Reverse engineer generates virtual collection and reference navigation properties.

class Post {
    public virtual Blog Blog { get; set; }
    public virtual ICollection<Comment> Comments { get; set; }
}

Given that we don't generate proxy types, should these be virtual?

@divega divega added this to the 1.1.0 milestone Aug 15, 2016
@divega
Copy link
Contributor

divega commented Aug 15, 2016

Triage: we shouldn't be generating virtual properties by default.

@gdoron
Copy link

gdoron commented Aug 15, 2016

When you'll add Lazy load, will we need to change everything to virtual?

@bricelam bricelam changed the title RevEng: Should navigation properties be virtual? RevEng: Don't make navigation properties virtual Aug 15, 2016
@divega
Copy link
Contributor

divega commented Aug 16, 2016

@gdoron It depends on how lazy loading ends up being implemented. If we did it by generating proxy types at runtime then yes, very likely virtual would be needed to override the property getter. But there are other ways lazy loading could be implemented that wouldn't require it.

It is possible that we will revisit this decision once we know how lazy loading will look like, but when we discussed this today we thought that making the change for 1.1 help us reduce the impact of changing the behavior later, e.g. if at some point we decided to lazy load by default, it won't affect as much existing code.

@rowanmiller rowanmiller modified the milestones: 1.2.0, 1.1.0-preview1 Oct 6, 2016
@smitpatel
Copy link
Contributor

@divega - Should we remove virtual here?

@divega
Copy link
Contributor

divega commented Nov 19, 2016

@smitpatel I think so. Mostly because

if at some point we decided to lazy load by default, it won't affect as much existing code

@smitpatel smitpatel assigned smitpatel and unassigned lajones Nov 19, 2016
@smitpatel smitpatel added the closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. label Nov 21, 2016
@ajcvickers ajcvickers changed the title RevEng: Don't make navigation properties virtual Reverse engineering: Navigation properties should not be virtual by default May 9, 2017
@divega divega added closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. and removed closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. labels May 10, 2017
@ajcvickers ajcvickers modified the milestones: 2.0.0-preview1, 2.0.0 Oct 15, 2022
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

No branches or pull requests

7 participants