I have a list of strings and I have to define a rule to validate my ModelState in Web API.
Each string element of this list should have length = 2 only. not greater than 2 or less than 2.
I wrote something like this, but it is not working.
RuleFor(m => m.State.TrueForAll(x => x.Length == 2)).Equals(true);
could someone help me out here.