Simple question where do I put my basic initialization code

Posts   
 
    
KastroNYC
User
Posts: 96
Joined: 23-Jan-2006
# Posted on: 05-Feb-2006 01:28:58   

I'm using self-servicing two class mode and I want to default certain properties when the entity is instantiated using the New() constructor. Do I go into [EntityName]Entity.vb and then under the New() constructor which currently looks like this:

Public Sub New MyBase.New(New PropertyDescriptorFactory(), New EmployeeEntityFactory()) End Sub

Do I change it to this?

Public Sub New MyBase.New(New PropertyDescriptorFactory(), New EmployeeEntityFactory()) Me.EmployeeType = EnumEmployeeType.Guest Me.Status = EnumEmployeeStatus.Employed End Sub

Also how do I use the validator class?

Thanks.

-Kasi

sparmar2000 avatar
Posts: 341
Joined: 30-Nov-2003
# Posted on: 05-Feb-2006 20:09:37   

Hi Kasi Please have a look in the manual at "Using the generated code" -->"Generated code - Adding your own code to the generated classes" section.

Hopefully the information you need is all there, but if you have any more query please fell free to come back.