Last post Feb 23, 2014 09:46 PM by Terry Guo - MSFT
Feb 21, 2014 03:03 PM|kandiyaar|LINK
Am trying to use class file that is being generated by XSD.exe for the XSD file i have.
when it gets converted , it converts in to one single cs file which had many partial classes inside in it.
i think of using this cs but could not find a way for it .
any lights on this is highly appreciated , thanks in advance.
Feb 23, 2014 09:46 PM|Terry Guo - MSFT|LINK
I find it counter-productive to separate generated code. I always like to generally follow the "one class per file" rule, but I make an exception here, because I often deal with very large schemas. Even in their own directory, I don't want to have to
diff tens (to hundreds) of files when I generate a new version of the code. I find it very convenient to have all the generated code diffable in one file.
Now, to offer a possible solution -
Resharper has the ability to pull all the classes out of a file and put them in their own files. If you right click the file in the solution explorer, you can say "Refactor -> Move types into matching files...". Of course, this isn't anywhere near as
convenient as just generating it this way, but I don't know of a tool that will do that.
Hope it helps.