Questions tagged [validation-application-bl]

The Enterprise Library Validation Application Block provides a library of classes, called validators, that supplies the code for validating .NET Framework data types. For example, one validator checks for null strings and another validator checks that a number falls within a specified range.

48 questions
2
votes
2 answers

Custom validator not invoked when using Validation Application Block through configuration

I have set up a ruleset in my configuration file which has two validators, one of which is a built-in NotNullValidator, the other of which is a custom validator. The problem is that I see the NotNullValidator hit, but not my custom validator. The…
Chris
  • 219
  • 1
  • 4
  • 12
2
votes
1 answer

validation application block object validator not working with rulesets

Ive been battling with this issue which I originally thought may have been to do with polymorphism/inheritance affecting my validation but ive narrowed it to this... Here is the class structure.. public class Employee { [ObjectValidator(Ruleset…
boz
  • 419
  • 5
  • 15
2
votes
2 answers

Apply Custom Validator by interface

Let's say I have an interface: public interface ISomeInterface { bool SomeBool { get; set; } string ValueIfSomeBool { get; set; } } And I have a number of classes that implement that. i.e. public class ClassA : ISomeInterface { #region…
2
votes
1 answer

Fluent validation or EntLib Validation Application Block for WCF services

I am looking for a standard way to add validation of the input parameters to the set of WCF services. Can anyone give comparison of Fluent validation http://fluentvalidation.codeplex.com/ and EntLib Validation Application Block? What are…
Michael Freidgeim
  • 26,542
  • 16
  • 152
  • 170
1
vote
3 answers

Validate assemblies and namespaces in VAB config file

We are using version 4.1 of the validation application block. I am relatively new to it so I was wondering if it had the ability to either abstract out the configured namespaces and assemblies or otherwise provide proper validation of their…
1
vote
3 answers

Stack overflow when using Microsoft EnterpriseLibrary validation

I have two classes: [HasSelfValidation] class Country : DomainObject { [NotNullValidator] [StringLengthValidator(2, 10)] public string Name { get; set; } [ObjectCollectionValidator(typeof(Region))] public List Regions {…
lmsasu
  • 7,459
  • 18
  • 79
  • 113
1
vote
1 answer

Issues with inheritance and Validation Application Block's ObjectCollectionValidator

I'm sorry if this has been asked before, I tried many combinations of keywords to describe the issue but was unable to find anything on Google or SO. The problem is simple: and I have a List of objects. I've marked this list with…
Bruno Brant
  • 8,226
  • 7
  • 45
  • 90
1
vote
1 answer

WPF, EntLib: PropertyComparisonValidator does not update the UI of the compared value

I have a problem with the PropertyComparisonValidator of EntLib 5.0. I set up an simple form with an Min and a Max field. The validation is: when Min >= Max both properties are invalid. [RangeValidator(10, RangeBoundaryType.Inclusive, 100, …
1
vote
1 answer

Enterprise Library 5.0 - Validation - Refresh

I am using the Validation Application Block (VAB) of the Enterprise Library 5.0. All is working well and I get the appropriate messages, but when I navigate to another tab in the tab control and navigate back the validation messages have all…
David Ward
  • 3,739
  • 10
  • 44
  • 66
1
vote
1 answer

Validation Application block and model localization

I can use ErrorMessageResourceName and ErrorMessageResourceType to translate rules into my language. But how do I translate class name and properties? Currently I get something like Valideringsmeddelande för 'LastName' as validation message. I want…
jgauffin
  • 99,844
  • 45
  • 235
  • 372
1
vote
1 answer

Enterprise library with linq-to-sql?

I wanted to get any feedback (put out a feeler) for how the enterprise library plays with linq-to-sql generated classes. I was considering using the validation handler to provide validation logic/display to the UI level. I am considering the caching…
1
vote
2 answers

wcf and Validation Application Block unit testing

I'm trying to test validation that I've setup for my wcf service. What's the best way to do it? [ServiceContract] [ValidationBehavior] public interface IXmlSchemaService { [OperationContract(Action = "SubmitSchema")] [return:…
1
vote
0 answers

Enterprise Library Validation Application Block validate object to relative object in hierarchy

I have a kind of hierarchycal class, meaning that it contains collections of user defined objects. I want to be able to apply validation at child level but referencing some properties in the parent level. Is there a way to do this with the build in…
1
vote
2 answers

Validate age by date of birth using Enterprise Library Validation Application Block

I have the following situation: A domain model that has a property BithDay. I want to be able to verify that the age (that will be computed accordingally to the birthday) is lower than 150 years. Can I do that by using the built in validtors or I…
1
vote
1 answer

Reading EntLib 4.1 configuration from an in-memory XML string

I'd like to use the EntLib 4.1 in my current project, specifically Unity 1.2 and the VAB. My application is an SaaS application, so I've made a decision to store tenant-specific configuration files in the database, to be loaded on tenant sign-in.…