public async Task <Object> Get() { var userId = User.Claims.First(c => c.Type == "id").Value; Guid userIdObj = Guid.Parse(userId); var result = await mmseRepository.GetById(userIdObj); return(new { result.Score, result.Description }); }
public async Task <ActionResult <MmseSurvey> > GetById(Guid id) { try { var result = await mmseRepository.GetById(id); if (result == null) { return(NotFound()); } return(result); } catch (Exception) { return(StatusCode(StatusCodes.Status500InternalServerError, "Error retrieving data from the database")); } }