i have viewmodel have viewmodel inside, take look
[validator(typeof(parentvalidatorvm))] public class parentvm { public childvm { get; set; } public parentvm () { this.childvm = new childvm (); } } //rulles validation internal sealed class parentvalidatorvm : abstractvalidator<parentvm> { public parentvalidatorvm() { //set rules this.rulefor(x => x.childvm).notvalidate(); //the row above example method 'notvalidate', invented } }
the childvm has structure properties
[validator(typeof(childvalidatorvm))] public class childvm { //my properties } //rulles validation internal sealed class childvalidatorvm : abstractvalidator<childvm> { public childvalidatorvm() { //set rules } }
my problem is, when call modelstate.isvalid
rules child comes rules parent, not happen. know way avoid it?
Comments
Post a Comment