My model has:
Property name could not be automatically determined for expression x => x. Please specify either a custom property name by calling 'WithName'.
public List<int> WindowGlassItems { get; set; }
Model Validator hasRuleFor(x => x.WindowGlassItems).SetCollectionValidator(new WindowGlassItemsValidator());
public class WindowGlassItemsValidator : AbstractValidator<int>
{
public WindowGlassItemsValidator()
{
RuleFor(x=>x).NotNull().NotEqual(0).WithMessage("GLASS REQ");
}
}
Im getting:Property name could not be automatically determined for expression x => x. Please specify either a custom property name by calling 'WithName'.