-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
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
Data Annotation Extensions #69834
Comments
These aren't tied to ASP.NET. This is a generic data annotations requests for recursive validation. Also extension methods on object are not great. I would prefer to see a static method here Validator class. |
I agree with you, I have thought about this before. public interface IValidatable
{
Tuple<bool, ICollection<ValidationResult>> Validate();
} We can implement abstarct class public class TodoCommand : Validatable
{
// [ValidationAttr]
// Prop ...
} I guess maybe the user wanted to use other packages for validation, they can customize them or even package development teams can create a way to customize it. If we go this way, we can change the whole structure of requests and use |
Summary
To complete minimal validations(#30666) we should have some data annotations extensions.
I have an idea and I want to know if you agree with it to apply it?
Motivation and goals
The idea is to quickly validate objects
Examples
Validation extensions:
Minimal Apis:
@halter73 @davidfowl
I think this idea is good but I don't know which project or folder for this methods.
If you are agree I implement this extensions and create pull request.
The text was updated successfully, but these errors were encountered: