Beispiel #1
0
 private static void PrettyPrint(AccountReportTable accountTable)
 {
     foreach (var row in accountTable)
     {
         Console.WriteLine($"Account {row.Id} for {row.Name} at {row.Address}");
     }
 }
Beispiel #2
0
        static void Main(string[] args)
        {
            var runtime = new DemoRuntime();

            runtime.Start();
            var accountTable = new AccountReportTable();

            runtime.ServiceLocator.Register(accountTable);

            var commandBus = runtime.ServiceLocator.Resolve <ICommandBus>();

            var command = new OpenAccountCommand("Petr", "Kolbenova 43");


            commandBus.Send(command);

            PrettyPrint(accountTable);
            var id          = accountTable.First().Id;
            var moveCommand = new MoveUserToAddressCommand(id, "Dankova 45");

            commandBus.Send(moveCommand);

            PrettyPrint(accountTable);

            runtime.Shutdown();

            Console.WriteLine("Finished");
            Console.ReadKey();
        }
Beispiel #3
0
 public AccountReportDenormalizer(AccountReportTable table)
 {
     _table = table;
 }