Skip to content

Instantly share code, notes, and snippets.

@joeybeninghove
Created January 22, 2010 22:16
Show Gist options
  • Save joeybeninghove/284212 to your computer and use it in GitHub Desktop.
Save joeybeninghove/284212 to your computer and use it in GitHub Desktop.
public class WorkflowModule : NinjectModule
{
public override void Load()
{
...
ConfigureCommand<SaveRecord, ISaveRecordWorkflow, SaveRecordWorkflow>();
ConfigureCommand<SetOwnershipActionData, ISetOwnershipWorkflow, SetOwnershipWorkflow>();
ConfigureCommand<SetExpirationDateActionData, ISetExpirationDateWorkflow, SetExpirationDateWorkflow>()
ConfigureCommand<FillActionData, IFillWorkflow, FillWorkflow>();
ConfigureCommand<AddNewActionData, IAddNewWorkflow, AddNewWorkflow>();
...
}
private void ConfigureCommand<CommandType, Interface, Implementation>() where Implementation : Interface
{
Bind<ICommand<CommandType>>()
.To<UnregisterableCommand<CommandType>>()
.WithConstructorArgument("underlyingCommand", ctx => ctx.Kernel.Get<Interface>());
Bind<Interface>().To<Implementation>();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment