Hi,
I have constructed several business objects similar to the design of the ProjectTraker example. I am now trying to get an XML representation of the created objects and I am running through some issues.
Since XMLSerializer only serializes public fields or properties - what can I do with the read only type objects (although they all have public properties that implement get functionality the XMLSerializer will only serialize properties implementing both get and set)?
I also added an empty constructor to NameValueListBase in order for the inherited NameValueListBase objects.
Any insights?
Thanks
Shai
What do you need the XML representation for? If we knew that, we could potentially make better suggestions.
FWIW, you could look at implementing the IXmlSerializable interface - it's designed to customize how .NET's XML serializers work with your objects. But that's a bit of work, and depending on what you need the XML for, I wouldn't necessarily recommend that approach.
CSLA objects don't necessarily play well with .NET's XML serializers, which is one of many reasons why Rocky suggests an alternate approach when discussing web services.
- Scott
Copyright (c) Marimer LLC