is it possible to use a class created by xsd.exe or by paste to XML as class (VS13), as a normal object? The situation is this, I have a WebService(WS) that receives an Xml
and returns an answer (captain obvious). The xsd as 2000+ lines, so I would like to be able to work with this class that was created and when I wanted to send the info I would serialize it again and send it.
The problem is that when I do the class foo = new class()
it's empty/null, no error is given except the NullReferenceException
.
For what I can understand the problem should be coming from the constructor. The empty constructor is created but as no parameters.
So my question is how can I use the class as a normal one, because 2000+ lines file as a lot of attributes that I would like to avoid to be rewritten. What kind of constructor do I have to write or method to generate\create the object.
Edited after the marked this question as duplicate: I say in my question that it gives the NullReferenceException probably because no arguments on the constructor and so it isn't initialized. But for me to initialize it would be very hard (time consuming aka boring) because there are more than 200 partial classes in this class. If that is the only way then so be it. I'm here asking if there is an alternative. Sorry if I didn't explain myself well. Should I ask again due to the marked as duplicate?