public IActionResult Post([FromBody] ImageScoreDto scoreInfo) { try { int userId = int.Parse(User.Claims.FirstOrDefault(claim => claim.Type == ClaimTypes.NameIdentifier).Value); return(Ok(_imageRepository.AddScore(scoreInfo.ScoreValue, scoreInfo.ImageId, userId))); } catch (ImageRepositoryException e) { return(BadRequest(e.Message)); } }