Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 1st, 2012  |  syntax: None  |  size: 0.51 KB  |  hits: 13  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1.     public class MyCommandHandler : Define.Handle<MyCommand>
  2.     {
  3.         private readonly Func<MyCustomContext> contextFactory;
  4.  
  5.         public MyCommandHandler(Func<MyCustomContext> contextFactory)
  6.         {
  7.             this.contextFactory = contextFactory;
  8.         }
  9.  
  10.         #region Implementation of IConsume<in Command>
  11.  
  12.         public void Consume(MyCommand message)
  13.         {
  14.             var context = contextFactory();
  15.  
  16.             Console.Out.WriteLine(context.TenantId);
  17.         }
  18.  
  19.         #endregion
  20.     }