private static New <DecisionResponseEnumerator> BindConstructorArguments(DecisionResponse decisionResponse) { return(new New <DecisionResponseEnumerator>(() => { IntPtr result = CreateDecisionEnumeratorAdapter(decisionResponse.DangerousGetHandle()); GC.KeepAlive(decisionResponse); // Extend the lifetime of this handle because the delegate (and its data) is not stored on the heap. return result; })); }
public bool TryRequestDecision(string contextJson, ActionFlags flags, DecisionResponse response, ApiStatus apiStatus) { int result = LiveModelRequestDecisionWithFlags(this.DangerousGetHandle(), contextJson, (uint)flags, response.DangerousGetHandle(), apiStatus.ToNativeHandleOrNullptrDangerous()); return(result == NativeMethods.SuccessStatus); }
public bool TryRequestDecision(string contextJson, DecisionResponse response, ApiStatus apiStatus = null) { int result = LiveModelRequestDecision(this.DangerousGetHandle(), contextJson, response.DangerousGetHandle(), apiStatus.ToNativeHandleOrNullptrDangerous()); GC.KeepAlive(this); return(result == NativeMethods.SuccessStatus); }