DTO and ReadOnly Fields

Posts   
 
    
Maxus
User
Posts: 76
Joined: 04-Aug-2006
# Posted on: 21-Aug-2007 07:21:20   

Hi People,

I have started using the DTO pattern, but run into a bit of a catch, our application uses RowVersion for concurrency checking, converting the entities to DTO works fine and they travel across to the application happily, but the catch is when you convert the DTO back into and entity I get and exception that the rowversion is readonly, which makes sense. but obviously in this situation i need to be able to set it without it throwing an error, how do I set the readonly rowversion field on the entity?

Thanks! Alex

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 21-Aug-2007 08:52:41   

Use the EntityField's method ForcedCurrentValueWrite(). Please check it in the LLBLGen Pro reference manual.

Maxus
User
Posts: 76
Joined: 04-Aug-2006
# Posted on: 22-Aug-2007 08:07:38   

Thanks Walaa! saved the day yet again, I might need to spend a bit more time with the manual wink