/// <summary> /// OnMethodBegin callback /// </summary> /// <param name="instance">Instance value, aka `this` of the instrumented method.</param> /// <param name="connection">The MongoDB connection</param> /// <param name="cancellationToken">The cancellation token</param> /// <typeparam name="TTarget">Type of the target</typeparam> /// <typeparam name="TConnection">Type of the connection</typeparam> /// <returns>Calltarget state value</returns> internal static CallTargetState OnMethodBegin <TTarget, TConnection>(TTarget instance, TConnection connection, CancellationToken cancellationToken) where TConnection : IConnection { var scope = MongoDbIntegration.CreateScope(instance, connection); return(new CallTargetState(scope)); }
/// <summary> /// OnMethodBegin callback /// </summary> /// <param name="instance">Instance value, aka `this` of the instrumented method.</param> /// <param name="connection">The MongoDB connection</param> /// <param name="cancellationToken">The cancellation token</param> /// <typeparam name="TTarget">Type of the target</typeparam> /// <returns>Calltarget state value</returns> public static CallTargetState OnMethodBegin <TTarget>(TTarget instance, object connection, CancellationToken cancellationToken) { var scope = MongoDbIntegration.CreateScope(instance, connection); return(new CallTargetState(scope)); }