Created
January 22, 2010 22:16
-
-
Save joeybeninghove/284212 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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