public async Task <ActionResult> Put([FromBody] VagaDtoUpdate campanha) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } try { var result = await _service.Put(campanha); if (result != null) { return(Ok(result)); } else { return(BadRequest()); } } catch (ArgumentException e) { return(StatusCode((int)HttpStatusCode.InternalServerError, e.Message)); } }
public async Task <VagaEntity> Put(VagaDtoUpdate vaga) { var entity = _mapper.Map <VagaEntity>(vaga); return(await _repository.UpdateAsync(entity)); }