validation-application-bl

How do I create a custom validator in VAB that tests two properties at once?

Hi In my database, I have a composite unique key constraint (CustomerId, Name) on a entity. I want to test if the unique constraint is upheld before submitting changes to the database. The user can customize the Name attribute on the entity, so I would like to make a custom validator that validates the name property, but while doing it,...

.NET WinForms and the enterprise library validation application block

I have a TextBox whose value is passed to an int property in an object after being parsed to an int. When I use a ValidationProvider this conversion step is ignored when validating and I get an error telling me that I cannot save the string to an int32. I can fix this by creating a string property in my object that acts as a bridge bet...

Which validation framework to choose: Spring Validation or Validation Application Block (Enterprise LIbrary 4.0)?

I am trying to choose one of the validation frameworks for a major application, and while both options seem enticing, I was wondering whether there are any specific pros and cons I should be aware of before committing to one or the other. ...

validation application block object validator not working with rulesets

Howdy, 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 = "A")] public EmployeeName Name { get; set; } public Employee() {...

Validate interface using IoC

Hi guys, I have a domain model that uses IoC with Microsoft Unity. For the validation I use VAB and I decorate the interface, not the entity. The code the following: interface IJob : IValidable { [NotNullValidator] string Name { get; set; } } interface IValidable { bool IsValid { get; } void ValidationResults Validate(); } class J...

Validation Application Block Questions

Hi, Has anyone used the validation application block from enterprise library? Any success? Anyways, my question is with regards to validating a numeric unique identifier. Lets say I have a Product class, with a ProductId property representing the unique identifier of the product. It is numeric. This identifier cannot be less than 1...

"Could not load file or assembly 'Microsoft.Practices.EnterpriseLibrary.Validation" exception

I am currently getting the following exception while trying to use the Enterprise Library Validation Application Block: An error occurred creating the configuration section handler for validation: Could not load file or assembly 'Microsoft.Practices.EnterpriseLibrary.Validation, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856a...

C# Model Validation - Validation Application Block or DataAnnotations?

I want to add validator attributes to my domain models (in an ASP.NET MVC app), and I'm trying to decide between 2 frameworks, the Validation Application Block and DataAnnotations. They appears to do similar tasks, so I want to pick the one which will be the most supported/used in the future. It seems DataAnnotations are newer (and built...

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 custom validator is being used to validate an Entity Framework entity object. I have used...

MS Validation Block or Workflow Rules engine?

For a large application that will be developed, we are in the process of selecting a Validation framework. Although the Workflow Rules engine is not strictly a Validation framework, it can be used by itself without using the Workflow foundation. It appears to give flexibility of specifying the rules in a database that is used at runtime....

Why should I use PropertyProxyValidator? ASP.NET

I understand thatthe PropertyProxyValidator integrates with the ASP.NET UI. But, it cannot do client side validation. How would it be any different from throwing in a label in the UI and populating the errors on the server side? Also, If I am using Validation Application Block, what approaches do you suggest for client side validation i...

Using Unity Framework & Validation Application Block to Validate Method Parameters

Question Is it posible to have the Validation.Validate() method of the Validation Application Block see each parameter of the IParameterCollection supplied by Unity as my custom UserModel? Background: I am attempting to use both Unity and the Validation Application Block to validate method parameters. I would like to be able to d...

wcf generated classes and validation application block attributes

Hi, I'm new to the validation application block and trying to use it with wcf... I have a wcf service that has data objects with validation rules defined with attributes, using the validation application block . On my client side (WPF), I have a service reference. When I update the service reference the generated classes do not have th...

.Net Object validation

Can I use Validation Application Block, for a high performance program? I mean when I'm getting objects from a stream and I need to validate their values as I parse data coming. As I understand reflection is involved... Is there any alternative tools that i can use for object validation? ...

Enterprise library validation application block with inheritance

I'm using Enterprise library Validation application block. abstract Class A { public int fieldA; } class B:A { } I add validators to type B. I'm not able to find the field fieldA and also even if I enter it in configuration, the validation does not succeed. Does VAB not take the abstract class and inherited properties or fields into...

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: MessageParameter(Name = "SubmitSchemaReturn")] [FaultContract(typeof(ValidationFault))] JobData...

Enterprise Library Validation Application Block and Internationalization

Scenario A .NET/WPF desktop application should be localized (or in MS terms globalized) to a different language than English. That is, the UI needs to be adopted completely (labels, icons, ...). Log file entries, audit trail entries, and other outputs of the application, however, should remain in English to allow the English-speaking ...

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 handler, validation, and authorization handlers primarily. ...

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 LastName to be localized too. ...

Making validation part of application settings

I am looking for examples of configuration based validation using Validation Application Block. I've found this I want to ask if someone has an alternative solution to using EL VAB 5.0 to achieve configuration based validation. I've started with DataAnnotations but soon found out that some properties will need different types of validat...