Skip to content
This repository was archived by the owner on Dec 26, 2025. It is now read-only.
This repository was archived by the owner on Dec 26, 2025. It is now read-only.

Validator of collection object #247

@bluepink116

Description

@bluepink116

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    QuestionQuestion about this projectTriageIssue needs to be triaged

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions