public void Setup() { // // observers SystemObserver.Setup(new IObserver<ISystemEvent>[] { new ConsoleObserver() }); // // message router Router = new MemoryMessageRouter(); Router.RegisterHandler<CreateAccount>(new CreateAccountHandler().Handle); Router.RegisterHandler<AccountCreated>(new AccountCreatedHandler().Handle); // // message bus var bus = new NullBus(); CommandBus = bus; EventBus = bus; // // Queue Writer var queueWriter = new QueueWriterToBus(bus); // // Misc Sender = new MessageSender(new IQueueWriter[] { queueWriter }); Identifier = new AccountID(Guid.NewGuid()); }
/// <summary> /// Initializes the <see cref="None"/> null object /// pattern property. /// </summary>u static DomainEventBus() { None = new NullBus(); }