Skip to content

Instantly share code, notes, and snippets.

@RemiBou
Created September 10, 2012 12:31
Show Gist options
  • Save RemiBou/3690659 to your computer and use it in GitHub Desktop.
Save RemiBou/3690659 to your computer and use it in GitHub Desktop.
public class Program
{
public static void Main(params object[] para)
{
//ninject bootstrapping
var standardKernel = new StandardKernel();
standardKernel.Bind<DbContext>().To<DbContext>();
standardKernel.Bind<MessageProcessor>().To<MessageProcessor>();
MessageProcessor messageProcessor = standardKernel.Get<MessageProcessor>();
//link the commands with their handlers, and the events with their observers
messageProcessor.Initialize(new[]{typeof(Product)});
//execute the command
messageProcessor.Execute(new SellProductCommand()
{
CustomerId = 1,
ProductId = 2,
SellerComment = "bla bla"
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment