public static void GetObject(AnyReference obj, MethodReturnEventArgs<Zetbox.API.IDataObject> e, Zetbox.API.IZetboxContext ctx) { if (obj.ObjClass == null) { e.Result = null; } else { var cls = _frozenCtx.FindPersistenceObject<ObjectClass>(obj.ObjClass.Value); var ifType = ctx.GetInterfaceType(cls.GetDataType()); if (obj.ObjGuid != null) { e.Result = (IDataObject)ctx.FindPersistenceObject(ifType, obj.ObjGuid.Value); } else { e.Result = ctx.Find(ifType, obj.ObjID.Value); } } }