What happens to constructor when used with DataContracts?

DataContractSerializer emits and eats XML. The default constructor is always invoked when deserializing this XML back to an instance of a class. So if you deserialize back to the same class the constructor code will be run But if you have exposed this class in a WCF webservice and generated a client proxy, then this client proxy will not have any of the custom code that you have written in the methods or constructors.

DataContractSerializer emits and eats XML. The default constructor is always invoked when deserializing this XML back to an instance of a class. So if you deserialize back to the same class the constructor code will be run.

But if you have exposed this class in a WCF webservice and generated a client proxy, then this client proxy will not have any of the custom code that you have written in the methods or constructors.

What I making is a quiz where I serialize and deserialize the quiz but I want the questions and choices shuffled when the xml has be loaded. The constructor is doing that so I wanted to make sure that was what was happening. – Joseph Le Brech Jul 22 at 10:49.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions