EF is a ORM framework which make developer’s life easier (do not need to spend so much time on writing sql)
However, using EF is not a easy task. Here are some helpful tips while we use EF;
- Ensure we filter the data at the database level (ToList and ToArray filter inside memory and not at sql level.)
- Complicated query need to be separated into small chunks because EF are not good at solving that.
- when it comes to a complex query, we can use stored procedure to do it.
- EF track any changes of the objects inside. you can create some outside object.
- we need to slowly insert records into database
- add the right indexing is super important
- use sql profiler would be helpful.