|
|
|
Forum Member
      
Group: Forum Members
Last Login: 2011-12-15 02:08:37
Posts: 35,
Visits: 260
|
|
I want to set the attribute default value of the class when the class is created,how should I do?
If I modify the (class name).eco.cs file,when I regenerate code ,the code which I add will be lost.
Please help me.
thank you!
|
|
|
|
|
Supreme Being
      
Group: Forum Members
Last Login: 2011-11-23 02:03:59
Posts: 80,
Visits: 730
|
|
Assuming you're using Eco5, you can make use of the ObjectCreated partial method, e.g.
public partial class MyEcoClass
{
partial void ObjectCreated()
{
this.GUID = Guid.NewGuid();
}
}
|
|
|
|
|
Forum Member
      
Group: Forum Members
Last Login: 2011-12-15 02:08:37
Posts: 35,
Visits: 260
|
|
|
|
|
|
Supreme Being
      
Group: Administrators
Last Login: 2010-11-30 12:17:13
Posts: 1 230,
Visits: 1 382
|
|
For most attribute types, you can also set the initial value directly in the model (in the properties window), but setting a new guid I think has to be done with the partial ObjectCreated-method.
/Jonas Hogstrom [CapableObjects]
|
|
|
|