コード例 #1
0
        public async Task <ActionResult <IEnumerable <Survey> > > GetAllSurveys(string userId)
        {
            try
            {
                var surveys = await _repository.GetAllSurveys();

                foreach (var survey in surveys)
                {
                    survey.FilledAlready = await _repository.CheckIfUserCanFillOutSurvey(userId, survey.Id);
                }
                return(Ok(surveys));
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
                return(BadRequest());
            }
        }