Update a record using UnitOfWork2

Posts   
 
    
bunzee
User
Posts: 84
Joined: 20-Mar-2007
# Posted on: 09-Nov-2007 02:29:09   

llblgen v2.0 .net framework 2.0

Hi,

I have a need to use the create a UnitOfWork2 object. In scenario 1 this uow2 is used for saving a record. In scenario 2 this uow2 is used for updating a record.

Question: 1. How can I construct a uow2 object that can be used for updating a record? 2. In the documentation it said

You can't use the UnitOfWork2 to store select actions or update directly in the database kind of actions

. However the PerformWork routine of the llblgenprodatasource2 handles CUD by accepting a unitofwork2 instance. Is there a contradiction here?

Thank you,

BZ

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 09-Nov-2007 10:39:50   

I think that line needs to be re-written.

UOW supports updates for sure, you just use the uow.AddEntityForSave(myEntity); and it would be updated or inserted according to its IsNew flag.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39908
Joined: 17-Aug-2003
# Posted on: 09-Nov-2007 12:44:03   

I'll correct the docs on this. It's indeed not true anymore.

Frans Bouma | Lead developer LLBLGen Pro