Emulating Default Constraints from code?

Posts   
 
    
simmotech
User
Posts: 1024
Joined: 01-Feb-2006
# Posted on: 23-Apr-2012 17:11:37   

Since we are experimenting with model first, we won't have any triggers or constraints in the DB not created from within LLBLGen.

Is it as simple as just setting the properties from InitClassMembers if the default is known by the entity or dependency injection if we need to configure it externally?

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 23-Apr-2012 18:55:27   

Do you want Default Values to be available once a new entity is created, or only when the entity is saved, for those uneditied fields?

simmotech
User
Posts: 1024
Joined: 01-Feb-2006
# Posted on: 26-Apr-2012 11:26:45   

Walaa wrote:

Do you want Default Values to be available once a new entity is created, or only when the entity is saved, for those uneditied fields?

For a new entity but now you mention it, is it possible to recognize fields that have not been set?

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 26-Apr-2012 19:38:28   

I think you need to check the validation section in the docs.