/// <summary> /// OnMethodBegin callback /// </summary> /// <typeparam name="TTarget">Type of the target</typeparam> /// <typeparam name="TRequest">Type of the request</typeparam> /// <param name="instance">Instance value, aka `this` of the instrumented method.</param> /// <param name="requestMessage">HttpRequest message instance</param> /// <param name="cancellationToken">CancellationToken value</param> /// <returns>Calltarget state value</returns> public static CallTargetState OnMethodBegin <TTarget, TRequest>(TTarget instance, TRequest requestMessage, CancellationToken cancellationToken) where TRequest : IHttpRequestMessage { return(HttpMessageHandlerCommon.OnMethodBegin(instance, requestMessage, cancellationToken, IntegrationId, IsIntegrationEnabledFunc)); }
/// <summary> /// OnAsyncMethodEnd callback /// </summary> /// <typeparam name="TTarget">Type of the target</typeparam> /// <typeparam name="TResponse">Type of the response, in an async scenario will be T of Task of T</typeparam> /// <param name="instance">Instance value, aka `this` of the instrumented method.</param> /// <param name="responseMessage">HttpResponse message instance</param> /// <param name="exception">Exception instance in case the original code threw an exception.</param> /// <param name="state">Calltarget state value</param> /// <returns>A response value, in an async scenario will be T of Task of T</returns> public static CallTargetReturn <TResponse> OnMethodEnd <TTarget, TResponse>(TTarget instance, TResponse responseMessage, Exception exception, CallTargetState state) where TResponse : IHttpResponseMessage { return(new CallTargetReturn <TResponse>(HttpMessageHandlerCommon.OnMethodEnd(instance, responseMessage, exception, state))); }
/// <summary> /// OnMethodBegin callback /// </summary> /// <typeparam name="TTarget">Type of the target</typeparam> /// <typeparam name="TRequest">Type of the request</typeparam> /// <param name="instance">Instance value, aka `this` of the instrumented method.</param> /// <param name="requestMessage">HttpRequest message instance</param> /// <param name="cancellationToken">CancellationToken value</param> /// <returns>Calltarget state value</returns> internal static CallTargetState OnMethodBegin <TTarget, TRequest>(TTarget instance, TRequest requestMessage, CancellationToken cancellationToken) where TRequest : IHttpRequestMessage { return(HttpMessageHandlerCommon.OnMethodBegin(instance, requestMessage, cancellationToken, IntegrationId, implementationIntegrationId: null)); }