public IActionResult AirplaneAdd([FromBody] AirplaneViewModel model) { if (!ModelState.IsValid) { NotificarErroModelInvalida(); return(Response(model)); } _airplaneService.Adicionar(_mapper.Map <AirplaneModel>(model)); return(Response()); }
public int AdicionarAirplane([FromBody] Airplane airplane) { if (airplane != null) { _airplaneService.Adicionar(airplane); return(1); } else { return(-1); } }
public void Insert([FromBody] AirplaneViewModel airplaneViewModel) { var airplane = _mapper.Map <Airplane>(airplaneViewModel); _airplaneService.Adicionar(airplane); }