Class SpectreConsoleTypeResolver
Resolves types from the primary host provider first, and falls back to Spectre's late runtime registrations.
Inherited Members
Namespace: Coree.NETStandard.SpectreConsole
Assembly: Coree.NETStandard.dll
Syntax
public sealed class SpectreConsoleTypeResolver : ITypeResolver, IDisposable
Constructors
| Edit this page View SourceSpectreConsoleTypeResolver(IServiceProvider, IServiceProvider, bool)
Initializes with the primary host provider and a secondary runtime provider.
Declaration
public SpectreConsoleTypeResolver(IServiceProvider primaryProvider, IServiceProvider runtimeProvider, bool disposePrimaryProvider)
Parameters
| Type | Name | Description |
|---|---|---|
| IServiceProvider | primaryProvider | Primary service provider for type resolution. |
| IServiceProvider | runtimeProvider | Runtime registration provider for late Spectre registrations. |
| bool | disposePrimaryProvider | True to dispose the primary service provider on disposal. |
Methods
| Edit this page View SourceDispose()
Disposes the runtime provider, and optionally the primary provider.
Declaration
public void Dispose()
Resolve(Type?)
Resolves a service of the specified type.
Declaration
public object? Resolve(Type? type)
Parameters
| Type | Name | Description |
|---|---|---|
| Type | type | Service type; returns null if type is null. |
Returns
| Type | Description |
|---|---|
| object | Service object or null if not found. |
Implements
Spectre.Console.Cli.ITypeResolver