0

Is their any way we can have conditional Mandatory Data fields in dataContract , for eg - We have IsRequired property as a part of DataMember attribute to make sure particular data field is always passed , is their any way in which we can make data field as conditional mandatory in WCF ?

ankush
  • 949
  • 2
  • 14
  • 33

1 Answers1

0

I don't think there is any such direct support through some property attribute. However you can create a service or endpoint behavior (depending on your requirement) and validate data members/fields as per your validation rules.

Learner
  • 4,661
  • 9
  • 56
  • 102