2 , , :
1. difficulty .
Validator , difficulty , :
[MaxLength(1)] public string difficulty { get; set; } = "a_string_that_is_too_long";
2. validateAllProperties: true Validator.TryValidateObject.
Validator.TryValidateObject , , validateAllProperties: true, Required . :
var isValid = Validator.TryValidateObject(recipe,
context,
results,
validateAllProperties: true);