I am trying to implement an ISO standard which by summary has the following:
- There are
operations(like an action in MVC)
- There are respective
XSD's are changing per year (as per my observation)
Here are my challenges for now:
C#classes generation (via VS command line) are so much pain. There are certain classes like
Enum's which are common to these
XSDs but are getting generated separately.
I only need specific properties from each
response, the other values will be mapped to its
responseas return values. Which creates a conflict because of my problem in #1
mapping the header from the request to response is not straightforward because they are of different classes. Same for other classes and enum values.
I can manually map these values from
responseof all the
operationsthat I need. But now my problem is the item #4 from my summary above. These
XSD's are getting updates per year. I saw some considerable amount of change from last year's version to now like new values added to enum and new elements in XML.
Here are my thoughts for next action:
- Is there any
C#classes generator which is smart enough not to duplicate the common classes and enumerations? This will primarily solve my problem as the mapper will be easily created. But doing it manually is an issue of deadlines and also the changing
- If #1 is not a feasible solution, I am thinking of
PropertyCopierswhich can map values from different classes. But I haven't searched of such copiers that can map nested classes (deep property copiers). I would only rely on
propertyNameswhich I can say is not reliable enough and reflection is quite slow.
My last resort is doing the mapper manually like:
DifferentClass1.SamePropertyName1 = DifferentClass2.SamePropertyName1
and just do another mapper again next year when the next version comes.