Getting sequenced field value before insertion

Posts   
 
    
orenpeled
User
Posts: 53
Joined: 25-Jul-2005
# Posted on: 04-Aug-2005 15:30:17   

Hi all,

Is there any way to make PK field initialized with a predefined sequence, say, during the creation of the entity? The point is, I cannot wait for the SaveEntity operation, because unfortunatelly I actually do not use LLBLGen directly for performing insertions....

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 04-Aug-2005 18:31:20   

Yes, please see "using the generated code - Adding your own code to the generated classes", in where initialization include templates are discussed which generate code into the init routines for the entities.

Surround your set routines with: if(fields.State==EntityState.New) { // your init code }

Frans Bouma | Lead developer LLBLGen Pro