Esempio n. 1
0
        public async Task <ActionResult <Customer> > CreateNewWaitingAirline([FromBody] AirlineDTO airline)
        {
            long           id;
            AirlineCompany airlineCompany = m_mapper.Map <AirlineCompany>(airline);

            try
            {
                id = await Task.Run(() => m_facade.AddNewWaitingAirline(airlineCompany));
            }
            catch (DuplicateDetailsException ex)
            {
                return(StatusCode(400, $"{ex.Message}"));
            }
            airlineCompany.Id = id;
            return(Created($"api/Anonymous/CreateNewWaitingAirline/{id}", JsonConvert.SerializeObject(airlineCompany)));
        }