Want to set an attribute for a field in my table for the input to the limited two "S" or "P".
I cannot find how you would do that. I applied your StringRangeAttribute class and it works beautifully when I enter a valid answer. But if I put in a dummy incorrect response to test it, it returns the prompt requiring a valid response but empties a navigation property of a different field on the same page. I can then enter the correct response but I can't save because I can't enter anything into the navigation property . I'm sure it is when isvalid is false but I don't understand what's happening nor can I find the problem.
if (AllowableValues?.Contains(value?.ToString()) == true)
{
return ValidationResult.Success;
}
var msg = $"Please enter one of the allowable values:
{string.Join(", ", (AllowableValues ?? new string[] { "No
allowable
values found" }))}.";
return new ValidationResult(msg);
}