A specialized IDependencyInjectionFramework implementation that handles Microsoft.Extensions.Logging.ILogger
dependencies by generating the correct code pattern for .NET Core logging.
Implements
Namespace: Metalama.Extensions.DependencyInjection.Implementation
Assembly: Metalama.Extensions.DependencyInjection.dll
Syntax
public sealed class LoggerDependencyInjectionFramework : DefaultDependencyInjectionFramework, IDependencyInjectionFrameworkRemarks
Unlike the standard dependency injection pattern where the constructor parameter type matches the dependency type,
the ILogger service requires a parameter of type ILogger<T>, where T is the current type
used as a logging category.
This framework is automatically registered with a higher priority than DefaultDependencyInjectionFramework
and only handles dependencies of type Microsoft.Extensions.Logging.ILogger.
Constructors
| Name | Description |
|---|---|
| LoggerDependencyInjectionFramework() |
Methods
| Name | Description |
|---|---|
| CanHandleDependency(DependencyProperties, in ScopedDiagnosticSink) | Determines whether the current instance can handle a DependencyAttribute aspect or IntroduceDependencyAttribute advice. |
| GetStrategy(DependencyProperties) | Gets an instance of the DefaultDependencyInjectionStrategy class for a given context. |