WCF Parameter validation

Topics: Validation Application Block
Feb 19, 2015 at 1:19 PM
Edited Feb 19, 2015 at 1:20 PM
Hi everyone,

I'm using the Validation Integration with WCF and so far, it is exactly doing what I want, besides this one fact:

I want to use a (resource) MessageTemplate with some of my WCF method parameters and format the name of the parameter into my template.

Usage is as following:

[NotNullValidator(MessageTemplate = "Parameter {1} may not be null.")]

However, it appears as I cannot use the {1} formatting placeholder in the MessageTemplate (-ResourceName) property of the Validation attributes.

What I'm currently doing is using the {2} placeholder and the Tag property, retyping the parameter Name.

Is this intentional or does anybody know a "better" workaround for this?

Many thanks and best regards

Stevie H