From 2cb7fdbfb70774f2836886959378cae19fc7b1b7 Mon Sep 17 00:00:00 2001 From: shept Date: Tue, 13 May 2025 19:15:45 +0500 Subject: [PATCH] mappers to new naming --- SurveyBackend/SurveyBackend.API/Mappers/QuestionMapper.cs | 6 +++--- SurveyBackend/SurveyBackend.API/Mappers/SurveyMapper.cs | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/SurveyBackend/SurveyBackend.API/Mappers/QuestionMapper.cs b/SurveyBackend/SurveyBackend.API/Mappers/QuestionMapper.cs index e68b311..bede586 100644 --- a/SurveyBackend/SurveyBackend.API/Mappers/QuestionMapper.cs +++ b/SurveyBackend/SurveyBackend.API/Mappers/QuestionMapper.cs @@ -17,7 +17,7 @@ public static class QuestionMapper /// /// /// - public static QuestionBase QuestionCreationToModel(CreateQuestionDto dto, int surveyId) + public static QuestionBase QuestionCreationToModel(QuestionCreateDto dto, int surveyId) { return dto.QuestionType.ToLower() switch { @@ -47,10 +47,10 @@ public static class QuestionMapper /// /// /// - public static OutputQuestionDto ModelToQuestionDto(QuestionBase question) + public static QuestionOutputDto ModelToQuestionDto(QuestionBase question) { var withAnswerVariants = question.GetType() != typeof(TextQuestion); - return new OutputQuestionDto + return new QuestionOutputDto { Id = question.Id, SurveyId = question.SurveyId, diff --git a/SurveyBackend/SurveyBackend.API/Mappers/SurveyMapper.cs b/SurveyBackend/SurveyBackend.API/Mappers/SurveyMapper.cs index 55d90b3..be88b9c 100644 --- a/SurveyBackend/SurveyBackend.API/Mappers/SurveyMapper.cs +++ b/SurveyBackend/SurveyBackend.API/Mappers/SurveyMapper.cs @@ -14,7 +14,7 @@ public static class SurveyMapper /// /// /// - public static Survey CreateDtoToModel(CreateSurveyDto dto, int userId) + public static Survey CreateDtoToModel(SurveyCreateDto dto, int userId) { return new Survey { @@ -24,7 +24,7 @@ public static class SurveyMapper }; } - public static Survey UpdateDtoToModel(UpdateSurveyDto dto, int userId, int surveyId) => new Survey + public static Survey UpdateDtoToModel(SurveyUpdateDto dto, int userId, int surveyId) => new Survey { Id = surveyId, Title = dto.Title, @@ -37,9 +37,9 @@ public static class SurveyMapper /// /// /// - public static OutputSurveyDto ModelToOutputDto(Survey survey) + public static SurveyOutputDto ModelToOutputDto(Survey survey) { - return new OutputSurveyDto + return new SurveyOutputDto { Id = survey.Id, Title = survey.Title,