public INanoEventBus <T> GetNanoEventBus <T>() where T : IDomainDocument { return((INanoEventBus <T>)_nanoEventBusses.GetOrAdd(typeof(T), type => { DocumentTypeMap.TryAdd(type.FullName, type); return new NanoEventBus <T>(this); })); }
internal Task DistributePublishMessageAsync(NanoPublishMessage publishMessage) { //distribute nano message local callbacks Type documentType; if (DocumentTypeMap.TryGetValue(publishMessage.DocumentTypeName, out documentType)) { INanoEventBus nanoEventBus; if (NanoEventBusses.TryGetValue(documentType, out nanoEventBus)) { return(nanoEventBus.DistributeAsync(publishMessage)); } } throw new InvalidOperationException(); }
public GenericDocumentTest() { this.tf = new DocumentTypeMap(); tf.Add("even", typeof(GDTest)); tf.Add("odd", typeof(GDTest)); }