CommandHandlerModule.cs 420 B

1234567891011121314
  1. using Ninject.Modules;
  2. using System.CommandLine.Invocation;
  3. namespace CustomHostingDemo
  4. {
  5. public class CommandHandlerModule : NinjectModule
  6. {
  7. public override void Load()
  8. {
  9. Bind<InvocationContext>().ToMethod(ctx => CommandContextParameter.FromContext(ctx).Context);
  10. Bind<IDefaultArgs>().ToMethod(ctx => CommandContextParameter.FromContext(ctx).Args);
  11. }
  12. }
  13. }