protected TDomainService Resolve <TDomainService>() where TDomainService : SynchronizedDomainService <TDomainService>, new() { var service = new TDomainService(); service.Inject(_commandBus); return(service); }
public DomainService CreateDomainService(Type domainServiceType, DomainServiceContext context) { if (domainServiceType != typeof(TDomainService)) { throw new InvalidOperationException("Only DomainServices of type '{0}' can be instantiated with this factory."); } TDomainService domainService = this._createDomainService(); domainService.Initialize(context); return(domainService); }