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