I have a class which inherits from a generated abstract base class.
I simply want to hide some fields which are inherited from the base
class when it is serialised.
I have tried:
public class Details : GeneratedDetails
{
[XmlIgnore]
public new string Id
{
get{return base.lId;}
set{Id = value;}
}
and:
[XmlIgnore]
public override string Id
{
get{return base.lId;}
set{Id = value;}
}
}
All these do is serialise the base members instead. As the base class
is generated it is no good putting the [XMLIgnore] on the base class
members (although this is what I have had to do for now).
I have Googled extensively but found no examples or answers to this
problem - apart from creating a wrapper class which inherits from my
Details class and only exposes the members I want my visible in the
web service. That will create an immense amount of work as it will
mean replicating a load of methods and derived classes of the Details
class just for the web service and therefore defeating the object of
OO!
Please help!