示例#1
0
        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
            });
        }
示例#2
0
        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"));
            }
        }