Following the article: http://www.udidahan.com/2009/06/14/domain-events-salvation/
we can see that DomainEvents
implemantation uses DI container
public static IContainer Container { get; set; }
and then
if(Container != null) {
foreach(var handler in Container.ResolveAll<Handles<T>>()) handler.Handle(args);
}
Should I integrate DI container inside the same assembly I store domain objects or can I externalize/abstract away the Container.ResolveAll<Handles<T>>()
? (In my previous experiences I put all DI-related
stuff inside global.asax.cs
).
Technically I'm familiar only with Ninject DI container but probably will understand the concept so your advices/illustrations are appreciated.
Thanks!