Hi
A call to RuleFor should reference a property directly. You can't call Convert.ToInt32 from within a rule definition.
You'll either need to 1) change the data type of your ExpireMonth and ExpireYear properties to be ints. or 2) Use a custom Must rule that performs the conversion, rather than relying on GreaterThanOrEqualTo.
Example:
A call to RuleFor should reference a property directly. You can't call Convert.ToInt32 from within a rule definition.
You'll either need to 1) change the data type of your ExpireMonth and ExpireYear properties to be ints. or 2) Use a custom Must rule that performs the conversion, rather than relying on GreaterThanOrEqualTo.
Example:
// Assuming ExpireYear is still a string
RuleFor(x => x.ExpireYear).Must(x => Convert.ToInt32(x) >= DateTime.Now.Year)
Basically, you can't mix numeric validators with string properties, so you need to make sure you do the conversion somewhere (either before FV is invoked, or within the validator, but not within the RuleFor)