예제 #1
0
        public IActionResult ModifyCrew(int id, [FromBody] Crew crew)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest() as IActionResult);
            }
            var entity = service.ReformCrew(crew);

            return(entity == null?StatusCode(304) as IActionResult : Ok(entity));
        }
예제 #2
0
        public IActionResult ModifyCrew([FromBody] long crewId,
                                        [FromBody] long pilotId, [FromBody] IEnumerable <long> stewardressesIds)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest() as IActionResult);
            }
            var entity = service.ReformCrew(crewId, pilotId, stewardressesIds);

            return(entity == null?StatusCode(304) as IActionResult
                   : Ok(mapper.Map <CrewDTO>(entity)));
        }