Hide public Property when exposed through web service.
- by BrokeMyLegBiking
I would like to prevent a property from being exposed via my WCF web service. I tried adding the XmlIgnore attribute bug that didn't work. We are using .NET 3.5. WCF.
This doesn't work:
public class MyClass
{
public string S1 { get; set; }
[XmlIgnore]
public string S2NotExposed { get; set; }
}