This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Why does not the second query hit cache. FindById method of course hits cache. Order order = uow.Orders.Fisrt(o => o.Id == 1) order =uow.Orders.First(o => o.Id == 1)
For example LINQ to SQL understans this simple case (and it seems to me - only this case) and use identity map.
|
|
|
Hi Anton, The reason is that the above query is not translated into a FindById query rather it becomes a paged Find query. We could have a look at adding in a check though in the case like above where you are actually only operating over the base set and only specifying the identifier in the criteria - Ill have a look at this and update the thread if we add this in.
Jeremy |
|