In the Structural map, I have the following line working with domain events:
public void Dispatch<TEvent>(TEvent eventToDispatch) where TEvent : IDomainEvent { foreach (var handler in ObjectFactory.GetAllInstances<IDomainEventHandler<TEvent>>()) { if (handler.IsActive) handler.Handle(eventToDispatch); } }
I register them inside the StructureMap registry as follows:
x.AddAllTypesOf(typeof(IDomainEventHandler<>));
The first block above throws an Unknown error - Map structure code 400. Does anyone know how I can get certain types of a generic class from a strcuture map container?
TIA
Andrew
source share