DEV Community

Discussion on: Getting Familiar With The Awesome Repository Pattern

 
smailg profile image
SmailG

As Sam said you can switch from Lazy loading to Eager loading within EF in a few clicks with Lazy loading being the most used while Eager loading is good in some specific scenarios where you know that connected objects will be used in the future.

Also, use IQueryable vs IEnumerable to get the sorting done on the server.
However, it is evident that EF is slower than traditional SQL principles(connected and disconnected scenario) with the connected one being the fastest in pure speed. It's all about performance vs speed of development, and it really depends on the project you are working on.

I would go for EF with LINQ if performance is not a top priority, just because it saves so much time