// Generic method to unpack any object public static T readChildMessage <T>(GenericClass genericClass) where T : IMessage, new() { return(genericClass.MyObject.Unpack <T>()); }