Exemplo n.º 1
0
        public CustomersController(ICommandHandler <Command> commandHandler,
                                   CustomerSQLiteRepository sqliteRepository,
                                   CustomerMongoRepository repository, CustomerMessageListener listener)
        {
            _commandHandler   = commandHandler;
            _sqliteRepository = sqliteRepository;
            _mongoRepository  = repository;
            _listener         = listener;

            //if (_mongoRepository.GetCustomers().Count == 0)
            //{
            //    var customerCmd = new CreateCustomerCommand
            //    {
            //        Name = "Ajay",
            //        Email = "*****@*****.**",
            //        Age = 23,
            //        Phones = new List<CreatePhoneCommand>
            //        {
            //            new CreatePhoneCommand { Type = PhoneType.CELLPHONE, AreaCode = 123, Number = 7543010 }
            //        }
            //    };
            //    _commandHandler.Execute(customerCmd);

            //}
        }
Exemplo n.º 2
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);
     }
 }
Exemplo n.º 3
0
 public CustomerMessageListener(CustomerMongoRepository repository)
 {
     _repository = repository;
     new Thread(() =>
     {
         Start();
     }).Start();
 }
Exemplo n.º 4
0
 public CustomersController(
     ICommandHandler <Command> commandHandler,
     CustomerRepository sqliteRepository,
     CustomerMongoRepository repository
     )
 {
     _commandHandler   = commandHandler;
     _sqliteRepository = sqliteRepository;
     _mongoRepository  = repository;
 }
Exemplo n.º 5
0
 public CustomerMessageListener(CustomerMongoRepository repository)
 {
     _repository = repository;
 }
Exemplo n.º 6
0
 public CustomerMessageListener(CustomerMongoRepository repository)
 {
     _repository = repository;
     Debug.WriteLine("Message Listener.....................");
 }