Created
October 22, 2009 21:00
-
-
Save mhinze/216329 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 static class DomainEvents | |
{ | |
public static IContainer Container { get; set; } | |
public static IDomainEvent LastRaised { get; private set; } | |
public static void Raise<T>(T args) where T : IDomainEvent | |
{ | |
if (Container != null) | |
foreach (var handler in Container.GetAllInstances<IHandler<T>>()) | |
handler.Handle(args); | |
LastRaised = args; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment