mappers to new naming
This commit is contained in:
parent
cc2d98c710
commit
2cb7fdbfb7
2 changed files with 7 additions and 7 deletions
|
|
@ -17,7 +17,7 @@ public static class QuestionMapper
|
||||||
/// <param name="surveyId"></param>
|
/// <param name="surveyId"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
/// <exception cref="BadRequestException"></exception>
|
/// <exception cref="BadRequestException"></exception>
|
||||||
public static QuestionBase QuestionCreationToModel(CreateQuestionDto dto, int surveyId)
|
public static QuestionBase QuestionCreationToModel(QuestionCreateDto dto, int surveyId)
|
||||||
{
|
{
|
||||||
return dto.QuestionType.ToLower() switch
|
return dto.QuestionType.ToLower() switch
|
||||||
{
|
{
|
||||||
|
|
@ -47,10 +47,10 @@ public static class QuestionMapper
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="question"></param>
|
/// <param name="question"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public static OutputQuestionDto ModelToQuestionDto(QuestionBase question)
|
public static QuestionOutputDto ModelToQuestionDto(QuestionBase question)
|
||||||
{
|
{
|
||||||
var withAnswerVariants = question.GetType() != typeof(TextQuestion);
|
var withAnswerVariants = question.GetType() != typeof(TextQuestion);
|
||||||
return new OutputQuestionDto
|
return new QuestionOutputDto
|
||||||
{
|
{
|
||||||
Id = question.Id,
|
Id = question.Id,
|
||||||
SurveyId = question.SurveyId,
|
SurveyId = question.SurveyId,
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ public static class SurveyMapper
|
||||||
/// <param name="dto"></param>
|
/// <param name="dto"></param>
|
||||||
/// <param name="userId"></param>
|
/// <param name="userId"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public static Survey CreateDtoToModel(CreateSurveyDto dto, int userId)
|
public static Survey CreateDtoToModel(SurveyCreateDto dto, int userId)
|
||||||
{
|
{
|
||||||
return new Survey
|
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,
|
Id = surveyId,
|
||||||
Title = dto.Title,
|
Title = dto.Title,
|
||||||
|
|
@ -37,9 +37,9 @@ public static class SurveyMapper
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="survey"></param>
|
/// <param name="survey"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public static OutputSurveyDto ModelToOutputDto(Survey survey)
|
public static SurveyOutputDto ModelToOutputDto(Survey survey)
|
||||||
{
|
{
|
||||||
return new OutputSurveyDto
|
return new SurveyOutputDto
|
||||||
{
|
{
|
||||||
Id = survey.Id,
|
Id = survey.Id,
|
||||||
Title = survey.Title,
|
Title = survey.Title,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue