Skip to content
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

CTL-43: Validation annotations at Class level #500

Closed
GeertvanHorrik opened this issue Apr 9, 2013 · 10 comments
Closed

CTL-43: Validation annotations at Class level #500

GeertvanHorrik opened this issue Apr 9, 2013 · 10 comments
Assignees
Milestone

Comments

@GeertvanHorrik
Copy link
Member

Jira issue originally created by user facos:

[ValidateMeeting]
class MeetingModel : ModelBase
{
.....
}

@GeertvanHorrik
Copy link
Member Author

Comment created by @GeertvanHorrik:

How would this translate into a validator? Can you give us more information how you see this? For example, would the ValidateMeeting provide an IValidator implementation?

@GeertvanHorrik
Copy link
Member Author

Comment created by @GeertvanHorrik:

concerning validation at class (entity) level:

http://jeffhandley.com/archive/2010/10/12/EntityLevelValidation.aspx
This describes it pretty good (especially the first paragraph)…

@GeertvanHorrik
Copy link
Member Author

Comment created by @GeertvanHorrik:

I don't want people having to specify both the validation class and the method. Still considering what's the best way to implement this.

@GeertvanHorrik
Copy link
Member Author

Comment created by @GeertvanHorrik:

Naming conventions are my first thought, but I don't want to force other developers to be forced into a specific naming convention.

@GeertvanHorrik
Copy link
Member Author

Comment created by facos:

Would it be possible to support just a ValidationAttribute at entity level?
I'm also not a friend of specifying both the validation class and the method but
since the CustomValidationAttribute is just a derivation of ValidationAttribute
everybody has the choice to take or not....

@GeertvanHorrik
Copy link
Member Author

Comment created by @GeertvanHorrik:

Improved the Validator implementation. Now the ModelBase checks once whether a IValidatorProvider is registered in the ServiceLocator. If so, it will automatically get the IValidator from the IValidatorProvider.

It is still overridable per model.

@GeertvanHorrik
Copy link
Member Author

Comment created by @GeertvanHorrik:

Written custom AttributeValidatorProvider which caches and should be very, very fast and is registered by default.

Now up to writing unit tests.

@GeertvanHorrik
Copy link
Member Author

Comment created by @GeertvanHorrik:

See the documentation:

https://catelproject.atlassian.net/wiki/display/CTL/Validationviaspecialmodelvalidators

@GeertvanHorrik
Copy link
Member Author

Issue was closed with resolution "Fixed"

@GeertvanHorrik GeertvanHorrik added this to the 3.6.0 milestone Apr 12, 2017
@GeertvanHorrik GeertvanHorrik self-assigned this Apr 12, 2017
@lock
Copy link

lock bot commented Aug 27, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Aug 27, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant