New Post: Pass lambda into rulefor
HiThis isn't something that will work. You're assigning the expression do a dynamic, which the Length method won't work against as it's an extension method (the C# compiler doesn't support passing...
View ArticleCommented Issue: Activator.CreateInstance Problem [7119]
The following line of code when debugging finds the correct custom validator and steps into it's constructor and immediately throws a "Target of Invocation Exception". The inner exception states...
View ArticleNew Post: Pass lambda into rulefor
Hi Jeremy,Thanks for the update - I will try and find out what the TProperty is and assign it to this rather than dynamic.I apprecaited that you would not recommend this approach, but I love...
View ArticleNew Post: Pass lambda into rulefor
I think there are probably simpler ways to solve these problems...I'd steer away from a reflection-based / expression-tree building solution unless there's no alternative, as they tend to add...
View ArticleNew Post: Pass lambda into rulefor
Wow - thanks for the quick response - I will have a play around.Love the work :-)
View ArticleCommented Issue: Activator.CreateInstance Problem [7119]
The following line of code when debugging finds the correct custom validator and steps into it's constructor and immediately throws a "Target of Invocation Exception". The inner exception states...
View ArticleClosed Issue: Activator.CreateInstance Problem [7119]
The following line of code when debugging finds the correct custom validator and steps into it's constructor and immediately throws a "Target of Invocation Exception". The inner exception states...
View ArticleReopened Issue: Activator.CreateInstance Problem [7119]
The following line of code when debugging finds the correct custom validator and steps into it's constructor and immediately throws a "Target of Invocation Exception". The inner exception states...
View ArticleCommented Issue: Activator.CreateInstance Problem [7119]
The following line of code when debugging finds the correct custom validator and steps into it's constructor and immediately throws a "Target of Invocation Exception". The inner exception states...
View ArticleClosed Issue: Activator.CreateInstance Problem [7119]
The following line of code when debugging finds the correct custom validator and steps into it's constructor and immediately throws a "Target of Invocation Exception". The inner exception states...
View ArticleNew Comment on "CreatingAValidator"
RuleFor(x => x.Orders).SetCollectionValidator(new OrderValidator()) .Where(x => x.Cost != null); Is that means only set validator for orders which cost is not null? if so, move 'Where' statement...
View ArticleNew Post: Data Annotation vs Fluent API vs Fluent Validation
I need to clarify about Data Annotation,Fluent API and Fluent Validation.These are my questions:When I work with EF code first which technologies should I use as best practices and when ?Fluent API and...
View ArticleNew Post: Data Annotation vs Fluent API vs Fluent Validation
DataAnnotation and FluentValidation are both validation libraries that serve a similar purpose. They are used to ensure that the values that have been assigned to the properties on your object meet a...
View ArticleNew Post: Data Annotation vs Fluent API vs Fluent Validation
Hi Jeremy,First of all I must Thanks for your grate explanation.Lot of issues Which I had now cleared.One small question:Related to the My Q 3. That is when I set fluent API as above is that enough for...
View ArticleNew Post: Data Annotation vs Fluent API vs Fluent Validation
You still need to use something like the Required attribute if you want validation in your view. As I mentioned before, the modelbuilder is only used for defining the database field mappings - it does...
View ArticleNew Post: Data Annotation vs Fluent API vs Fluent Validation
Hi Jeremy,Thanks a lot.It's very clear Now.
View ArticleNew Post: Is it possible to check a method variable that's changed in the...
Is there an approach that allows for checking a method variable that's changed in the method registered to the rule? Noting that rules are fired prior to running the method code.As per below the...
View ArticleNew Post: rule sequence
Is their a way to specifiy the sequence in which rules will fire for properties of a given view model? I have a rule that is firing before a dependant rule and I can't find away to specify a sequence.
View ArticleNew Post: rule sequence
It depends how you're executing the rules. If you're calling the Validate method on the validator directly, then the rules are always executed in the order they're defined.If you're using...
View ArticleNew Post: Is it possible to check a method variable that's changed in the...
I'm not entirely sure I understand what you're trying to do. Do you mean that you want validation to automatically happen again every time the property value changes?
View Article