Esempio n. 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);
        }
Esempio n. 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);
        }