v2.0.5
Changes
Breaking change: CommandContext
implements IAsyncDisposable
and IDisposable
. Callers of CommandApp.Bind()
must dispose the returned context to release its service scope. (The all-in-one ExecuteAsync(string[], CancellationToken)
extension method does this for you.)
- Support scoped dependency resolution by creating a new service scope in
CommandApp.Bind()
and using it to resolve the command and parameters instances - Add a scoped dependency resolution abstraction:
- Implementations of
ITypeResolver
may, optionally, also implementITypeResolverScopeFactory
- If possible,
CommandApp
callsITypeResolverScopeFactory.CreateScope()
to get an instance ofITypeResolverScope
- The scoped
ITypeResolver
instance is exposed asCommandContext.CommandServices
for use by middleware
- Implementations of
- Implement
ITypeResolverScopeFactory
inXO.Console.Cli.Extensions
for seamless integration withMicrosoft.Extensions.DependencyInjection
Full Changelog: v1.1.4...v2.0.5