Created
September 10, 2012 12:31
-
-
Save RemiBou/3690659 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 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