New Post: Use HttpContext.User in Validator
Hello, I need the HttpContext.User in a validator. What is the best way to accomplish that? Use an interceptor? Inject a service in the constructor? (Maybe using a Func since the validator is static?)...
View ArticleNew Post: Use HttpContext.User in Validator
Yep, lazily-loading it with a Func is probably the best way to go. Jeremy
View ArticleCreated Unassigned: Set Validator with Arguments [7160]
Hello,I created a validator to specifically validate a User Email within many UserModels:``` public class UserEmailValidator : AbstractValidator<String> { public...
View ArticleCommented Unassigned: Set Validator with Arguments [7160]
Hello,I created a validator to specifically validate a User Email within many UserModels:``` public class UserEmailValidator : AbstractValidator<String> { public...
View ArticleClosed Unassigned: Set Validator with Arguments [7160]
Hello,I created a validator to specifically validate a User Email within many UserModels:``` public class UserEmailValidator : AbstractValidator<String> { public...
View ArticleCreated Unassigned: Specify rule set when using ValidateAndThrow [7161]
Is it not possible to specify rule sets to use when using ValidateAndThrow?
View ArticleReviewed: 5.0 (Dec 12, 2013)
Rated 5 Stars (out of 5) - Honestly: This makes validation fun. If you have any sort of complicated validation scenario, skip data annotations and use this.
View ArticleNew Post: Help with creating a custom validator
Hi to all, i would like to create a custom validator and i need some help. My validator needs four parameters (the object being validated, the parent object being validated, a boolean and the...
View ArticleNew Post: Custom Validator With Arguments
Hi, I want to implement a validator which would check if the property value is within a certain collection (list, params, array, etc.). It's a simple validator and I realize that I can use 'Must' to...
View ArticleNew Post: Help with creating a custom validator
Hi Not quite sure I understand what you're trying to do. Perhaps you could give a more concrete example? Anyway, all these things you need to access should be accessible from within your custom...
View ArticleNew Post: Custom Validator With Arguments
Yep, anything like this can be done within a custom property validator. Custom property validators have access to both the property being validated and its parent instance via the context parameter -...
View ArticleNew Post: Custom Validator With Arguments
Hi Jeremy, thanks for your answer. Sorry, perhaps it wasn't clear what I wanted to do in my original post - what I want to access is not a property of the parent instance, but rather a supplied...
View ArticleNew Post: Custom Validator With Arguments
Yes, this is perfectly possible. All the built-in validators (such as equal/length etc) are built as custom property validators under the covers. Essentially, you just take parameters as constructor...
View ArticleNew Post: Custom Validator With Arguments
Thanks Jeremy. I was able to get it to work now. :)For everyone: I blogged about what I did; please feel free to comment or critique! OJ
View ArticleNew Post: Help with creating a custom validator
Hi Jeremy, thanks for the reply, after some research i got it. I just had to add a Func as constructor parameter to my custom validator and add a Func parameter for the extension method for using my...
View ArticleNew Post: Till what extend fluent validation can be used in ASP.NET Webform...
I am planning to use this in my ASP.NET application, which is in web form patterns. I know we can use Fluent Validations just for server side validations in web forms, but I want to know if there are...
View ArticleNew Post: Till what extend fluent validation can be used in ASP.NET Webform...
Hi Client side validation only works with MVC, sorry. Jeremy
View ArticleCreated Unassigned: Add release notes to NuGet package [7162]
It would be very handy if the changelogs/release notes were added to the NuGet package, so you can view them directly when updating the package.The .nuspec provides a <releaseNotes> tag for this,...
View Article