Is there a way to handle the event or call back to the object that Protobuf has just deserialized without having to explicitly call the method from the deserialized object?
For example, let's say I have the following class:
[ProtoContract]
public class Customer
{
[ProtoMember(1)]
public string FirstName { get; set; }
[ProtoMember(2)]
public string MiddleName { get; set; }
[ProtoMember(3)]
public string LastName { get; set; }
[ProtoMember(4)]
public Dictionary<int, string> Addresses { get; set; }
public Customer()
{
}
public void ValidateAddresses()
{
}
}
Will there be a way to call "ValidateAddresses" without invoking it explicitly from the deserialized object in the code block where it was deserialized? Calling it in the constructor is useless, since Protobuf has not yet applied serialized values, so it would be nice to know when it finished applying the values. I hope there is a way to do this to eliminate the need to refactor a call to deserialize messages wherever this object is used.
, , , , - , ( ). .