- using Ninject.Modules;
- using System.CommandLine.Invocation;
- namespace CustomHostingDemo
- {
- public class CommandHandlerModule : NinjectModule
- {
- public override void Load()
- {
- Bind<InvocationContext>().ToMethod(ctx => CommandContextParameter.FromContext(ctx).Context);
- Bind<IDefaultArgs>().ToMethod(ctx => CommandContextParameter.FromContext(ctx).Args);
- }
- }
- }
|