|
-
May 30th, 2016, 12:53 AM
#1
Thread Starter
Frenzied Member
Create xml file from db entities?
Hi!
I got an xsd file from another department and they need data from our database as an xml message, formatted as in their xsd file. We use Entity Framework 6 as our OR mapper. Which is the best way to map our entities into this xsd format? The only solution I have is to create a "message class", e.g. a POCO-class with attributes that allow it to be serialized exactly as the xsd. The data has to be manually assigned from our entity models into the message class which is then serialzed into an xml stream. Before sending it to the other department, I run an xsd validation call to make sure it is valid (and we haevn't made any mistakes in the mapping process).
Any better ways? The format from the entity model and the xsd are quite different, and so is the naming of the different fields. Therefor I think it might be tricky to do this using some kind of framework?
/S
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|