Changing PK value

Posts   
 
    
Posts: 30
Joined: 08-Apr-2008
# Posted on: 08-Apr-2008 14:18:43   

Hi!

I'm just trying out LLBLGen Pro v2.0.0.0 and came up with a scenario with a User entity that has a username (PK), password and display name. I'm using the SelfServicing template.

When trying to update the User entity, I'm able to call FetchUsingPK to get an object instance from the DB. I then change the username attribute and call the Save method. This results in a new entity being created, rather than an update to the existing entity. I'm able to update all other attributes successfully.

Is there any way I can change the PK value using LLBLGen Pro? Also, if I change the PK value without using the LLBLGen Pro generated classes, would it affect the other data that I retrieve from LLBLGen Pro (perhaps the effect of a cache that LLBLGen Pro uses?)?

Any help appreciated.

Regards, NiTiN

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 09-Apr-2008 10:33:48   
Posts: 30
Joined: 08-Apr-2008
# Posted on: 09-Apr-2008 11:35:01   

I'm sorry, I just realised that updating the PK works fine with the code generated by LLBLGen Pro, but the error was in the code that I wrote up to call the generated code. I feel so sheepish right now. flushed

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 09-Apr-2008 11:39:40   

no problem at all.