You may do this with a list containing your conditions
var conditions = new List<string>() { str1, str2, str3 };
RuleFor(x => x.Parameter)
.Must(x => conditions.Contains(x))
.WithMessage("Please only use: " + String.Join(",", conditions));
You may do this with a list containing your conditions
var conditions = new List<string>() { str1, str2, str3 };
RuleFor(x => x.Parameter)
.Must(x => conditions.Contains(x))
.WithMessage("Please only use: " + String.Join(",", conditions));