public void Post([FromBody] StewardessDTO stewardess)
 {
     if (ModelState.IsValid)
     {
         Response.StatusCode = 200;
         stewardessService.CreateStewardess(stewardess);
     }
     else
     {
         Response.StatusCode = 400;
     }
 }
Example #2
0
        public async Task <IActionResult> Post([FromBody] StewardessDTO stewardess)
        {
            if (ModelState.IsValid)
            {
                await stewardessService.CreateStewardess(stewardess);

                return(Ok());
            }
            else
            {
                return(BadRequest());
            }
        }