Click here to Skip to main content
15,790,472 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:
DynamicEntity auth = new DynamicEntity(EntityAuthorization);
auth.Properties["DealerId] = authprm.new_dealerid[0].Value;
auth.Properties["CarId"] = authprm.new_carid[0].Value;

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!
Updated 3-Nov-14 9:54am

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