Hide public Property when exposed through web service.

Posted by BrokeMyLegBiking on Stack Overflow See other posts from Stack Overflow or by BrokeMyLegBiking
Published on 2010-04-12T16:31:41Z Indexed on 2010/04/12 16:43 UTC
Read the original article Hit count: 368

Filed under:
|

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; }
    }

© Stack Overflow or respective owner

Related posts about c#

Related posts about wcf