Exemplo n.º 1
0
        public static WriteModelFacade BuildTheWriteModelHexagon(IPedidoRepository grabarPedido, IClienteRepository manejarClientes, IPublishEvents eventPublisher, ISubscribeToEvents eventSubscriber)
        {
            var writeModelCommandHandler = new WriteModelFacade(new AlmacenarPedido(grabarPedido, manejarClientes, eventPublisher));

            CompositionRootHelper.SubscribeCommands(writeModelCommandHandler, eventSubscriber);

            return(writeModelCommandHandler);
        }
Exemplo n.º 2
0
        public static WriteModelFacade BuildTheWriteModelHexagon(ISaveBooking saveBooking, IHandleClients handleClients, IPublishEvents eventPublisher, ISubscribeToEvents eventSubscriber)
        {
            var writeModelCommandHandler = new WriteModelFacade(new BookingStore(saveBooking, handleClients, eventPublisher));

            CompositionRootHelper.SubscribeCommands(writeModelCommandHandler, eventSubscriber);

            return(writeModelCommandHandler);
        }
Exemplo n.º 3
0
 /// <summary>
 /// Subscribe the "command handler" to per-type command publication on the eventPublisher.
 /// </summary>
 /// <param name="writeModelFacade">The callback/handler provider.</param>
 /// <param name="bus">The eventPublisher to subscribe on.</param>
 private static void SubscribeCommands(WriteModelFacade writeModelFacade, ISubscribeToEvents bus)
 {
     bus.RegisterHandler <PedidoCommand>(writeModelFacade.Handle);
 }
Exemplo n.º 4
0
 /// <summary>
 /// Subscribe the "command handler" to per-type command publication on the eventPublisher.
 /// </summary>
 /// <param name="writeModelFacade">The callback/handler provider.</param>
 /// <param name="bus">The eventPublisher to subscribe on.</param>
 private static void SubscribeCommands(WriteModelFacade writeModelFacade, ISubscribeToEvents bus)
 {
     bus.RegisterHandler <PedidoCommand>(writeModelFacade.Handle);
     bus.RegisterHandler <CancelarPedidoCommand>(writeModelFacade.Handle); // the line to be added
 }