We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Does Prompt.Bind support also the IntegerValidator (MinValue, MaxValue), DefaultValue attributes in the model? I tried this :
public class MyModel { [Display(Name = "MyParam")] [IntegerValidator(MinValue = 1, MaxValue = 3)] [DefaultValue(2)] [Required] public int MyParam { get; set; } } ... var myModel = Prompt.Bind<MyModel>();
but see (0) as default, and can also enter any integer value.
The text was updated successfully, but these errors were encountered:
I think the following definition achieves the same thing.
public class MyModel { [Display(Name = "MyParam")] [Range(1, 3)] [Required] public int MyParam { get; set; } = 2; }
Sorry, something went wrong.
You are right, it works. Thanks! Where can I find the list with the supported annotations?
No branches or pull requests
Does Prompt.Bind support also the IntegerValidator (MinValue, MaxValue), DefaultValue attributes in the model?
I tried this :
but see (0) as default, and can also enter any integer value.
The text was updated successfully, but these errors were encountered: