static CommandDispatcher SetupDispatcher()
        {
            var repository        = new AggregateRepository();
            var commandHandlerMap = new CommandHandlerMap(new Handlers(repository));

            return(new CommandDispatcher(commandHandlerMap));
        }
        static Dispatcher()
        {
            var repository        = new AggregateRepository();
            var commandHandlerMap = new CommandHandlerMap(new Handlers(repository));

            Instance = new CommandDispatcher(commandHandlerMap);
        }
Example #3
0
    Dispatcher SetupDispatcher(EventStoreClient eventStore)
    {
        var repository = new AggregateRepository(eventStore);

        var commandHandlerMap = new CommandHandlerMap(new Handlers(repository));

        return(new Dispatcher(commandHandlerMap));
    }
Example #4
0
    public void RegisterHandlers <TCommandHandler>()
        where TCommandHandler : CommandHandler
    {
        var commandHandler    = (CommandHandler)Activator.CreateInstance(typeof(TCommandHandler), _repository) !;
        var commandHandlerMap = new CommandHandlerMap(commandHandler);

        _dispatcher = new Dispatcher(commandHandlerMap);
    }
        public static Dispatcher Get()
        {
            var eventStoreConnection = EventStoreConnection.Create(
                ConnectionSettings.Default,
                new IPEndPoint(IPAddress.Loopback, 1113));

            eventStoreConnection.ConnectAsync().Wait();
            var repository = new AggregateRepository(eventStoreConnection);

            var commandHandlerMap = new CommandHandlerMap(new Handlers(repository));

            return(new Dispatcher(commandHandlerMap));
        }
Example #6
0
        private static async Task <Dispatcher> SetupDispatcher()
        {
            var eventStoreConnection = EventStoreConnection.Create(
                ConnectionSettings.Default,
                new IPEndPoint(IPAddress.Loopback, 1113));

            await eventStoreConnection.ConnectAsync();

            var repository = new AggregateRepository(eventStoreConnection);

            var commandHandlerMap = new CommandHandlerMap(new Handlers(repository));

            return(new Dispatcher(commandHandlerMap));
        }
 public Dispatcher(CommandHandlerMap map)
 {
     _map = map;
 }
 public Dispatcher(CommandHandlerMap map) =>
        async Task <Dispatcher> GetDispatcher(AggregateRepository repo)
        {
            var commandHandlerMap = new CommandHandlerMap(new Handlers(repo));

            return(new Dispatcher(commandHandlerMap));
        }