Reputation: 449
I need to model a document which I will be persisting as XML. In the first instance I will be creating some POCO classes for use as View Models. I know that I could generate them via EF designer/T4. However I wonder whether this is the correct route since what I am actually trying to do is model a document and its contents which will then map across to an XML document and ultimately a schema if required.
I want to use the POCO VMs to provide strongly typed views and also to enable data annotations for validation etc. I can then serialise the data back to XML.
So what would be the best way to model and generate these POCOs please?
Many thanks in advance.
Upvotes: 0
Views: 51
Reputation: 31610
I don't think EF Designer will be useful here. It will be more work to draw all the boxes and add all the properties then coding it by hand. Why do you want your classes to be generated instead of just coded manually? It seems to add one more layer of complexity and may have no benefits... You could try using xsd.exe but the code it will generate will be heavily attributed (so no POCO).
Upvotes: 1