/// <summary> /// Configures the message domain for the instance of <see cref="CqrsEngineHost"/>. /// </summary> /// <param name="config">configuration syntax.</param> /// <returns>same builder for inline multiple configuration statements</returns> public void Domain(Action <DispatchDirectoryModule> config) { _directory = (registry, contractRegistry) => { var m = new DispatchDirectoryModule(); config(m); m.Configure(registry, contractRegistry); }; }
void Configure(IComponentRegistry reg) { var system = new SystemObserver(_observers.ToArray()); reg.Register <ISystemObserver>(system); // domain should go before serialization _domain.Configure(reg, _serializationList); _storageModule.Configure(reg); var serializer = _dataSerializer(_serializationList.GetAndMakeReadOnly()); var streamer = new EnvelopeStreamer(_envelopeSerializer, serializer); reg.Register(new MemoryAccount()); reg.Register(serializer); reg.Register <IEnvelopeStreamer>(c => streamer); reg.Register(_registry); }
/// <summary> /// Configures the message domain for the instance of <see cref="CqrsEngineHost"/>. /// </summary> /// <param name="config">configuration syntax.</param> /// <returns>same builder for inline multiple configuration statements</returns> public void Domain(Action<DispatchDirectoryModule> config) { _directory = (registry, contractRegistry) => { var m = new DispatchDirectoryModule(); config(m); m.Configure(registry, contractRegistry); }; }