public IActionResult PostPerfilVehiculo(int idUsuario, [FromBody] PerfilVehiculoDTO perfilVehiculoDto) { try { var vehiculo = vehiculoService.Crear(vehiculoMapper.FromPerfilVehiculoDTO(perfilVehiculoDto), idUsuario); return(StatusCode(StatusCodes.Status201Created, vehiculoMapper.ToPerfilVehiculoDTO(vehiculo))); } catch (FormatException fe) { return(UnprocessableEntity(new ErrorResponse(StatusCodes.Status422UnprocessableEntity, fe.Message))); } catch (Exception e) { return(errorResponseFactory.InternalServerErrorResponse(e)); } }
public async Task <IActionResult> Crear(VehiculoDto vehiculo) { await _vehiculoService.Crear(_mapper.Map <Vehiculo>(vehiculo)); return(Ok()); }