Skip to content

v2.0.5

Compare
Choose a tag to compare
@wjrogers wjrogers released this 09 Jun 16:50
· 5 commits to release-2.0 since this release

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 implement ITypeResolverScopeFactory
    • If possible, CommandApp calls ITypeResolverScopeFactory.CreateScope() to get an instance of ITypeResolverScope
    • The scoped ITypeResolver instance is exposed as CommandContext.CommandServices for use by middleware
  • Implement ITypeResolverScopeFactory in XO.Console.Cli.Extensions for seamless integration with Microsoft.Extensions.DependencyInjection

Full Changelog: v1.1.4...v2.0.5