I use [DataMember(IsRequired=true)]
to make the DataContract properties required. There doesn\'t seem to be some IsRequired for the OperationContract parameters
No. Just like any regular method, you'll need to check whether reference type parameters have a value or are null
.
Just apply your normal defensive programming patterns, checking reference types before accessing their properties.
Unfortunately it can't be done using default WCF. There exist a few workarounds:
You can however implement a FaultContract and throw a fault when the input parameter is null.