Esempio n. 1
0
 public CustomersController(ICommandHandler <Command> commandHandler,
                            CustomerSQLiteRepository sqliteRepository,
                            CustomerMongoRepository repository,
                            CustomerMessageListener listener)
 {
     _commandHandler   = commandHandler;
     _sqliteRepository = sqliteRepository;
     _mongoRepository  = repository;
     if (_mongoRepository.GetCustomers().Count == 0)
     {
         var customerCmd = new CreateCustomerCommand
         {
             Name   = "George Michaels",
             Email  = "*****@*****.**",
             Age    = 23,
             Phones = new List <CreatePhoneCommand>
             {
                 new CreatePhoneCommand {
                     Type = PhoneType.CELLPHONE, AreaCode = 123, Number = 7543010
                 }
             }
         };
         _commandHandler.Execute(customerCmd);
     }
 }
 public List <CustomerEntity> Get()
 {
     //new Events.CustomerMessageListener(_mongoRepository).Start();
     return(_mongoRepository.GetCustomers());
 }
Esempio n. 3
0
 public List <CustomerEntity> Get()
 {
     return(_mongoRepository.GetCustomers());
 }