public async Task <ActionResult <Footballer> > PutExistingFootballer(string footballerSurname, FootballerCommand command) { try { var footballerCurrentClub = command.CurrentClub; var updatedFootballer = _mapper.Map <Footballer>(command); await _repository.PutExistingFootballer(footballerSurname, footballerCurrentClub, updatedFootballer); _logger.LogInformation($"Footballer has been updated."); return(Ok()); } catch (System.Exception ext) { _logger.LogError(ext, "Footballer hasn't been updated."); // TODO return error object with proper error code. return(BadRequest()); } }