Mandatory Parameters in Request object (WCF)

Posted by Martin Moser on Stack Overflow See other posts from Stack Overflow or by Martin Moser
Published on 2010-05-21T08:35:15Z Indexed on 2010/05/21 8:40 UTC
Read the original article Hit count: 288

Filed under:
|
|

lHi,

I'm currently writing a WCF service. One of those methods get's a request object and returns a response object. In the request there are a couple of value-type members.

Is there a way to define members are mandatory in the declarative way? I'm in an early stage of development and I don't want to start with versioning now. In addition I don't want to have method sig with 25 parameters, therefore I created the request object.

The problem I have is that due to the value-types, I can never be sure if the consumer of the service intended to have the default value in there, or it was just by lazyness. On consumer side you don't easily detect that you probably missed that property.

So I would like to have something that forces the caller of the service to provide an value, and if not he ideally get's a compile-time error.

any ideas?

tia, Martin

© Stack Overflow or respective owner

Related posts about wcf

Related posts about parameter