Hi,
Hopefully someone can help as I have either misunderstood the concept of the Context facility or cannot get it to work.
My understanding is that if you request an entity twice using the same primary key from a context instance it should only hit the DB once to get field data. This is because the second request into the context should reuse the entity instance from the first request therefore removing the need for a second DB hit. Is this correct?
Assuming it is am I doing something wrong in my code as both samples below carry out 2 DB hits:
Context context = new Context();
ClubEntity entity1 = (ClubEntity)context.Get(new ClubEntity(218147));
ClubEntity entity2 = (ClubEntity)context.Get(new ClubEntity(218147));
Context context = new Context();
ClubEntity entity = new ClubEntity();
entity.FetchUsingPK(218147, null, context);
ClubEntity entity2 = new ClubEntity();
entity2.FetchUsingPK(218147, null, context);
Many Thanks.