public void Write(IWriteContext context, object obj)
 {
     CustomTypeHandlerTestCase.ItemGrandChild item = (CustomTypeHandlerTestCase.ItemGrandChild
                                                      )obj;
     context.WriteInt(item.age);
     context.WriteInt(100);
 }
            public void Activate(IReferenceActivationContext context)
            {
                CustomTypeHandlerTestCase.ItemGrandChild item = (CustomTypeHandlerTestCase.ItemGrandChild
                                                                 )((IReferenceActivationContext)context).PersistentObject();
                item.age = context.ReadInt();
                int check = context.ReadInt();

                if (check != 100)
                {
                    throw new InvalidOperationException();
                }
            }
 public override bool Equals(object obj)
 {
     if (!(obj is CustomTypeHandlerTestCase.ItemGrandChild))
     {
         return(false);
     }
     CustomTypeHandlerTestCase.ItemGrandChild other = (CustomTypeHandlerTestCase.ItemGrandChild
                                                       )obj;
     if (age != other.age)
     {
         return(false);
     }
     return(base.Equals(obj));
 }