How to use ValidationParameterInspector?

Topics: Validation Application Block
Jun 20, 2011 at 9:11 PM

Greetings!

First, I realise this is a rather rookie question (and I could dig into the source code), but how should I use Microsoft.Practices.EnterpriseLibrary.Validation.Integration.WCF.ValidationParameterInspector? It almost looks like using IParameterInspector would be easier. My first idea is that I need to inherit from Attribute to make is usable as a WCF inspector attribute (*). But in that case, I feel like I lose something (EntLib configuration in a .config file)... Does anyone have an example at hand or some advice how to best use parameter inspection in WCF without decorating data contract classes (not an option)?



Or then I could do something like Aaron Skonnard writes on his article in MSDN Magazine, Service Station: Extending WCF with Custom Behaviors at http://msdn.microsoft.com/en-us/magazine/cc163302.aspx.

Jun 21, 2011 at 8:44 AM

Hi,

I'm not really sure if you can directly consume ValidationParameterInspector. The documentation doesn't also give a hint. Maybe you are referring to ValidationBehavior. I found an article in CodeProject saying that:  

"this [ValidationBehavior] attribute adds a ValidationParametersInspector to each operation runtime definition in order to be executed each time a service operation is called."

 

Noel Angelo Bolasoc
Global Technologies and Solutions
Avanade, Inc.
entlib.support@avanade.com