My class looks like this:
public class MyClass
{
private void MyClass() { } //just to satisfy the XML serializer
public void MyClass(int a, int b)
{
A = a;
B = b;
C = a + b;
}
public int A { get; set; }
public int B { get; set; }
public int C { get; private set; } //private set is only to
//satisfy the XML Serializer
public void DoSomeMath()
{
Console.WriteLine("{0} + {1} = {2}\n", A, B, C)
}
}
This works fine when I instantiate my own myClass object with a & b parameters, but the deserializer will only call the paramaterless constructor. How do I initialize C without creating another method and calling that after I deserialize?