KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I have a class: public class MyClass { public MyClass(){} } I would like to be able to use an XMLSeralizer to Deserialize an XDocument directly in the constructor thus: public class MyClass { private XmlSerializer _s = new XmlSerializer(typeof(MyClass)); public MyClass(){} public MyClass(XDocument xd) { this = (MyClass)_s.Deserialize(xd.CreateReader()); } } Except I am not allowed to assign to "this" within the constructor. Is this possible?
Tags (comma-separated)
Save Edits
Cancel