Kemal Kocabiyik

Kemal Kocabiyik kkocabiyik

Niner since 2013


  • Entity Framework Tips and Tricks

    It is my pleasure to help people =] I have couple of questions again. I will be glad if you enlighten me Smiley

    1- I'm agree with improving EF performance by using AsNoTracking as well as setting ProxyCreationEnabled = false.  As you know with EF5 there is a lot performance improvements and its more of that on EF6 with SQL query optimization (I voted on it btw Tongue Out). I think you are alike using lazy-loading and using AsNoTracking while retrieving lists or something Smiley. Doesn't it reduce performance if you have like 1.000.000 rows? Because it will retrieve all the objects and cache in memory unless dbcontext is disposed.

    2- Relating with the first question, assume we return no tracked objects, isn't it problematic for their navigation properties if our business logic is based on parallel transactions? Or do you think that it is up to design? 

    3- What if there is a nested TransactionScope in a method? Does it reduce perfomance or wrap into a one big TransactionScope? 


  • Entity Framework Tips and Tricks

    I  have asked julie why didn't use virtual keyword on navigation properties in her example and she replied me the keyword "virtual" must be used on navigation properties only if dbcontext is available for lazy loading. Thanks for your answer julie!