DEV Community

Discussion on: Why ORMs Aren't Always a Great Idea

Collapse
 
rehmatfalcon profile image
Kushal Niroula

While the article is well written, I do have issue with this statement.

However, if you're using an ORM, due to the fact that you have no control over the code that it generates, you simply have ZERO control over whether or not you can run into this problem.

Most ORM that I have used allow me to eager fetch data which means that the N+1 problem simply does not occur. EfCore for example by default disables lazy loading asking you to load relationships eagerly if you need, but also allows lazy loading if you need.

Collapse
 
harshhhdev profile image
Harsh Singh

I see, interesting. I have updated the statement to say 'some' ORMs. Thank you for pointing this flaw out.

Some comments have been hidden by the post's author - find out more