public Controller(ConsoleView view, BalanceReadModel rm, string streamName, string localFile)
 {
     _view       = view;
     _rm         = rm;
     _streamName = streamName;
     _localFile  = localFile;
 }
 public Controller(ConsoleView view, BalanceReadModel rm, string streamName, string localFile)
 {
     _view = view;
     _rm = rm;
     _streamName = streamName;
     _localFile = localFile;
 }
        static void Main()
        {
            Console.WriteLine("Loading EventStore");

            EventStoreLoader.SetupEventStore();
            //Create a private copy of the Checkpoint file to support running multiple instances of the app in the same folder
            var privateCopy = Guid.NewGuid() + ".csv";

            if (File.Exists(ReadModelFile))
            {
                File.Copy(ReadModelFile, privateCopy);
            }

            _consoleView = new ConsoleView();

            _balanceRm = new BalanceReadModel(_consoleView, StreamName, privateCopy);

            _sessionStatsRm = new SessionStatsReadModel(_consoleView);

            _controller = new Controller(_consoleView, _balanceRm, StreamName, privateCopy);

            _controller.StartCommandLoop();

            //if we saved a checkpoint copy it back
            if (File.Exists(privateCopy))
            {
                File.Copy(privateCopy, ReadModelFile, true);
                File.Delete(privateCopy);
            }
        }
        static void Main()
        {
            Console.WriteLine("Loading EventStore");

            EventStoreLoader.SetupEventStore();
            //Create a private copy of the Checkpoint file to support running multiple instances of the app in the same folder
            var privateCopy = Guid.NewGuid() + ".csv";
            if (File.Exists(ReadModelFile))
                File.Copy(ReadModelFile, privateCopy);

            _consoleView = new ConsoleView();

            _balanceRm = new BalanceReadModel(_consoleView, StreamName, privateCopy);

            _sessionStatsRm = new SessionStatsReadModel(_consoleView);

            _controller = new Controller(_consoleView, _balanceRm, StreamName, privateCopy);

            _controller.StartCommandLoop();

            //if we saved a checkpoint copy it back
            if (File.Exists(privateCopy))
            {
                File.Copy(privateCopy, ReadModelFile, true);
                File.Delete(privateCopy);
            }

        }
Exemple #5
0
        static void Main()
        {
            Console.WriteLine("Loading EventStore...");

            EventStoreLoader.SetupEventStore();
            string privateCopy = CopyCheckpoint();

            _consoleView    = new ConsoleView();
            _balanceRm      = new BalanceReadModel(_consoleView, StreamName, privateCopy);
            _sessionStatsRm = new SessionStatsReadModel(_consoleView);
            _controller     = new Controller(_consoleView, _balanceRm, StreamName, privateCopy);

            _controller.StartCommandLoop();

            UpdateCheckpoint(privateCopy);
        }