Hmm....thats a way...not bad.....
What I would really like to do is be able through reflection determine
if a property base type implments IEnumerable.
I have an app that I have several functions I need to determine if a
given propety is a a type of Collection
It could (and in most cases is) a Generic Collection
It could be , and array , an array list , etc though.
How can I determine if its A collection, or enumerable ?
I hate to impose contratints like that on Domain Design that all
collections must be ignored....etc.
BUT its better than what I had so far.
If I could just figure out how to determine if a property implments
IEnum, etc...
Thanks
Chris
Andrew Brook wrote:
Hi Chris,
Could you just mark the address property of the Person object to be ignored
by the serializer (XmlIgnore i think). Serialise the Person to get your
first string, then iterate over the addresses and serialize them one by one?
ta,
Andrew
<cw******@gmail.comwrote in message
news:11**********************@16g2000cwy.googlegro ups.com...
Ok the XmlSerializer is nice for my need.
BUT I what I need (maybe the XmlSerializer isnt what I need) is to be
able to take the following
objects
A Person who has a collection of Addresses
Person
(fname)
(lname)
Address
(Street)
(City)
(State)
(Zip)
And Serialize the Person object Seperatly from the Addresses.
What is the best way to do this ?
Inverse recursion ?
What I would like in the end are 2 strings, 1 representing the Person
and 1 representing the address.
If there were 2 addresses then 3 strings, 1 for the person, and 1 for
EACH address.
Thanks
Chris