Missing Context.FindByObjectId method

Posts   
 
    
mihies avatar
mihies
User
Posts: 800
Joined: 29-Jan-2006
# Posted on: 06-Jun-2007 11:09:47   

Hi there,

I am tracking entites using a Dictionary<EntityBase2, ...>. Now, if I add an entity without a primary key set to the dictionary and later on I set the key the dictionary won't find it anymore due to EnttiyBase2.GetHashCode method implementation. So I am looking for more reliable way, ObjectID that is. It works, but then I have problems getting the entity instance....

mihies avatar
mihies
User
Posts: 800
Joined: 29-Jan-2006
# Posted on: 06-Jun-2007 11:32:24   

Hi Miha,

Or just use a custom IEqualityComparer for your dictionary - the one that compares ObjectId fields instead of PK values.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39749
Joined: 17-Aug-2003
# Posted on: 06-Jun-2007 11:35:38   

I'm glad you two get along so nicely wink

Frans Bouma | Lead developer LLBLGen Pro