Search code examples
c#wcfdatacontractserializerendpoint

How to deny WCF entities to show in some endpoints


i have a wcf service with 3 endpoints and i have within the service entities decorated with DataContract and DataMember.

my question is, is it possible to deny the datacontractserializer to do his job in some endpoints or i should create a new wcf service?

thanks.


Solution

  • This has been asked before at Exclude property on WCF DataContract

    The answer: no, it violates the contract defined on the class decorated with the DataContract and DataMember attributes.