Hi ,
By default , Ideablade uses StringLengthVerifier in auto
generated code for entity model like below ,
/// <summary>Gets or sets the Address2. </summary>
[Bindable(true, BindingDirection.TwoWay)]
[Editable(true)]
[Display(Name="Address2", AutoGenerateField=true)]
[IbVal.StringLengthVerifier(MaxValue=50, IsRequired=true, ErrorMessageResourceName="Doctor_Address2")]
[DataMember]
public string Address2 {
get { return PropertyMetadata.Address2.GetValue(this); }
set { PropertyMetadata.Address2.SetValue(this, value); }
}
#endregion Address2 property
Is there a way to supply my
own MyStringLengthVerifier
so that it generates the code like this.
/// <summary>Gets or sets the Address2. </summary>
[Bindable(true, BindingDirection.TwoWay)]
[Editable(true)]
[Display(Name="Address2", AutoGenerateField=true)]
[MyStringLengthVerifier
(MaxValue=50, IsRequired=true, ErrorMessageResourceName="Doctor_Address2")]
[DataMember]
public string Address2 {
get { return PropertyMetadata.Address2.GetValue(this); }
set { PropertyMetadata.Address2.SetValue(this, value); }
}
#endregion Address2 property
We would
like to handle IsRequired property differently. Currently if string column in database table
is set to NOT NULL , Ideablade turns IsRequired = true and doesn't allow
to assign empty string like '’ which is
valid value for NOT NULL fields in database.
So in above
case Address2 can be NOT NULL in database table and can still accept empty
string '' without triggering validation.
- Jignesh Suthar