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

Feature request: Load with proxy #997

Open
Tracked by #22954
hikalkan opened this issue Nov 2, 2014 · 2 comments
Open
Tracked by #22954

Feature request: Load with proxy #997

hikalkan opened this issue Nov 2, 2014 · 2 comments

Comments

@hikalkan
Copy link

hikalkan commented Nov 2, 2014

Hi,

NHibernate's Load method is really useful. Example:

var user = dbContext.Users.Load(42);

It does not perform SQL but creates a proxy object. If we want to use user's a properties, it's lazy loaded from DB. If we use only Id, it's not loaded from DB. Also, we may assign it to another entity's navigation property. Example:

var blog = new Blog(...);
blog.User = dbContext.Users.Load(42);
dbContext.Blogs.Add(blog);
dbContext.SaveChanges();

In this code, User 42 is never fetched from DB since we did not used it's properties (other than Id).

@rowanmiller
Copy link
Contributor

rowanmiller commented Nov 10, 2014

Team Triage: We agree this would be useful. We're not going to tackle it in the initial release of EF Core but leaving active to look at in the future.

@rowanmiller rowanmiller added this to the Backlog milestone Nov 10, 2014
@divega
Copy link
Contributor

divega commented Aug 8, 2016

Related: #1387

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants