Z
zlf
I have a class.
[Serializable]
public class A
{
private int id=0;
public int Id
{
get { return id; }
set { if (value < 1) { throw ArgumentException("Id cannot be less
than 1."); } id = value; }
}
}
And an instance A a = new A().
If I serialize this instance, then deserialize it back, I will get an
exception thrown by setter of Id since id is zero. Can u tell me how to make
deserializer to ignore those exceptions and finish the deserialization?
Thanks
[Serializable]
public class A
{
private int id=0;
public int Id
{
get { return id; }
set { if (value < 1) { throw ArgumentException("Id cannot be less
than 1."); } id = value; }
}
}
And an instance A a = new A().
If I serialize this instance, then deserialize it back, I will get an
exception thrown by setter of Id since id is zero. Can u tell me how to make
deserializer to ignore those exceptions and finish the deserialization?
Thanks