public class MyClass : ISerializable { public int MyProperty { get; set; } public void GetObjectData(SerializationInfo info, StreamingContext context) { info.AddValue("MyProperty", MyProperty); } protected MyClass(SerializationInfo info, StreamingContext context) { MyProperty = info.GetValue("MyProperty", typeof(int)); } }In this example, the class MyClass is implementing the ISerializable interface. The GetObjectData method adds the value of MyProperty to the SerializationInfo object named info using the AddValue method. The protected constructor takes the SerializationInfo object and sets the value of MyProperty by calling the GetValue method. Package Libray: The package library for System.Runtime.Serialization.SerializationInfo.GetValue method is System.Runtime.Serialization.