Esempio n. 1
0
        public async Task <ServiceResponseType> UpdateSurvey(int id, SurveyDto dto)
        {
            var survey = await _surveyRepository.GetAsync(id);

            if (survey == null)
            {
                return(ServiceResponseType.NotFound);
            }

            survey.Name        = dto.Name ?? survey.Name;
            survey.Description = dto.Description ?? survey.Description;

            await _surveyRepository.Edit(survey);

            return(ServiceResponseType.Ok);
        }