-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
[Question] What is the indented usage of populating entity properties? #14488
Comments
It's really going to be a case-by-case thing. The ORM is a nice layer to work with but in the end it's just a tool to alleviate the burden of managing a load of bespoke SQL statements and data access boilerplate code. Just find something that works, and if you have a true issue with performance or something, you'll have to work out those details for that particular case. It's the wild west and there are no rules. 🤠 |
@KieranDevvs I think what @tuespetre said is basically the same thing I would say. That is, it depends. For example, you might want to read some of the comments on the discussion about lazy-loading. |
Im currently using EF Core on a large project. My main problem with using it is, I'm unaware of what the intended process is for obtaining data. Is it best practice to let each method that uses the entities and their nested types, assume that the nested objects are populated from outside of the method? Or is it intended that each method should be responsible for obtaining the data that it needs?
Visual example for collecting the data from the start of a unit:
Visual example for for obtaining the relative data within each method:
My assumption is that its wiser to have the data present before beginning any logic as one large query is more optimal compared to the alternative several smaller queries (which is more taxing on the database).
The text was updated successfully, but these errors were encountered: