Example #1
0
 public void Raise <TEvent>(TEvent @event) where TEvent : IDomainEvent
 {
     using (var scope = context.BeginLifetimeScope("eventRaiser"))
     {
         foreach (var handler in scope.Resolve <IEnumerable <IDomainEventHandler <TEvent> > >())
         {
             handler.Handle(@event);
         }
     }     // scope is disposed - no memory leak
 }