You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a class: public class Customer { public string Name { get; set; } }
Validator is defined on the customer object: public class CustomerValidator : AbstractValidator<Customer> { public CustomerValidator() { // rule is defined on name here. } } public class CustomerCollectionValidator : AbstractValidator<List<Customer>> { public CustomerCollectionValidator () { RuleForEach(x => x).SetValidator(new CustomerValidator ()); } }
EditForm is Model is set to the List object.
But this is throwing below error:
Could not find property named x on object of type List.
I have a class:
public class Customer { public string Name { get; set; } }Validator is defined on the customer object:
public class CustomerValidator : AbstractValidator<Customer> { public CustomerValidator() { // rule is defined on name here. } } public class CustomerCollectionValidator : AbstractValidator<List<Customer>> { public CustomerCollectionValidator () { RuleForEach(x => x).SetValidator(new CustomerValidator ()); } }EditForm is Model is set to the List object.
But this is throwing below error:
Could not find property named x on object of type List.
Any ways to solve this error?
Thanks