Click here to Skip to main content
15,868,141 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I am receiving XML from the database and trying to process it into my system. I have generated a class from an XSD that I received from the other team. The problem I'm having is that, right now the property names in the XSD do not match up to the property names within my application (typical). Meaning in order for me to build an object that I can use I have to create an object and piece it together with the XML. Like this:
C#
DynamicEntity auth = new DynamicEntity(EntityAuthorization);
auth.Properties["DealerId] = authprm.new_dealerid[0].Value;
auth.Properties["CarId"] = authprm.new_carid[0].Value;
//etc...

I could potentially have 40 to 100 properties to set. This is not ideal. I've thought about applying XmlElement to the class attributes but every time I have to regenerate the class (from the XML) I will lose the XmlElements that I applied earlier. What are some suggestions?

Thanks everyone!
Posted
Updated 3-Nov-14 8:54am
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900