예제 #1
0
        public object Post([FromBody] EventsBuyingDTO eventsBuyingDTO)
        {
            var dtoConfig = AutoMapperConfig.RegisterAllMappings();
            var mapper    = dtoConfig.CreateMapper();

            apiAppService = new ApiAppService(new RabbitMQueue(),
                                              mapper, new EventsBuyingManagerService(new EventsBuyingCommandEFCoreRepository(
                                                                                         new EventsBuyingContext())));

            apiAppService.AddEventsBuying(eventsBuyingDTO);

            return(eventsBuyingDTO);
        }
예제 #2
0
        public void TestMethod1()
        {
            EventsBuyingDTO events = new EventsBuyingDTO
            {
                Id         = 1,
                IdEvento   = 2,
                Nome       = "Ale",
                NomeEvento = "Show Ivete"
            };

            var dtoConfig = AutoMapperConfig.RegisterAllMappings();
            var mapper    = dtoConfig.CreateMapper();

            var apiAppService = new ApiAppService(new RabbitMQueue(),
                                                  mapper, new EventsBuyingManagerService(new EventsBuyingCommandEFCoreRepository(
                                                                                             new EventsBuyingContext())));

            apiAppService.AddEventsBuying(events);
        }
예제 #3
0
        //Commands
        public void AddEventsBuying(EventsBuyingDTO eventsBuyingDTO)
        {
            var command = _mapper.Map <AddEventsBuyingCommands>(eventsBuyingDTO);

            _queue.Enqueue(command);
        }