Class ScopeInterceptor
Opens a scope, setting the state to the service type name on the configured logger.
Inheritance
System.Object
ScopeInterceptor
Namespace: Copper.Diagnostics.Service.Interceptors
Assembly: Copper.Diagnostics.Service.dll
Syntax
public class ScopeInterceptor : IReceiveInterceptor
Constructors
View SourceScopeInterceptor(ILogger<ScopeInterceptor>, IServiceContextProvider)
Initializes a new instance of the ScopeInterceptor class.
Declaration
public ScopeInterceptor(ILogger<ScopeInterceptor> logger, IServiceContextProvider serviceContextProvider)
Parameters
| Type | Name | Description |
|---|---|---|
| ILogger<ScopeInterceptor> | logger | The logger. |
| IServiceContextProvider | serviceContextProvider | The service context provider. |
Methods
View SourceInterceptAsynchronous(IInvocation)
Intercepts an asynchronous method invocation with return type of System.Threading.Tasks.Task.
Declaration
public void InterceptAsynchronous(IInvocation invocation)
Parameters
| Type | Name | Description |
|---|---|---|
| IInvocation | invocation | The method invocation. |
InterceptAsynchronous<TResult>(IInvocation)
Intercepts an asynchronous method invocation with return type of System.Threading.Tasks.Task<TResult>.
Declaration
public void InterceptAsynchronous<TResult>(IInvocation invocation)
Parameters
| Type | Name | Description |
|---|---|---|
| IInvocation | invocation | The method invocation. |
Type Parameters
| Name | Description |
|---|---|
| TResult | The type of the System.Threading.Tasks.Task<TResult> result. |
InterceptSynchronous(IInvocation)
Intercepts a synchronous method invocation.
Declaration
public void InterceptSynchronous(IInvocation invocation)
Parameters
| Type | Name | Description |
|---|---|---|
| IInvocation | invocation | The method invocation. |