XmlSerializer: Inheritance and Read-Only Properties
- From: "Michael Primeaux" <mjprimeaux@xxxxxxxxxxxxxx>
- Date: Fri, 20 Jan 2006 17:29:37 -0600
All,
Please maximize for easier viewing. Assume I have a class structure as
follows:
[Serializable]
public class Foo
{
private string _hello = "Hello";
public string Hello
{
get
{
return _hello;
}
}
}
public class Bar : Foo
{
private Foo _fooBar = new Foo();
private string _message = "This is a test";
public Foo FooBar
{
get
{
return _fooBar;
}
}
public string Message
{
get
{
return _message;
}
set
{
_message = value;
}
}
}
When serializing an instance of Bar using the XmlSerializer, I only see the
property named "Message" in my resulting XML string. How can I tell the
XmlSerializer to include all of Bar including read-only properties and all
of Foo (it's base class) in the resulting XML?
Kindest Regards,
Michael
.
- Follow-Ups:
- Re: XmlSerializer: Inheritance and Read-Only Properties
- From: Michael Primeaux
- Re: XmlSerializer: Inheritance and Read-Only Properties
- Prev by Date: Re: optional nillable values
- Next by Date: Re: problem consuming my service
- Previous by thread: Problems inserting repeating node.
- Next by thread: Re: XmlSerializer: Inheritance and Read-Only Properties
- Index(es):
Relevant Pages
|
Loading