Added- AnalyticsController ResponsesController SurveyController UserController
31 lines
728 B
C#
31 lines
728 B
C#
using survey_beta.DTOs.Create;
|
|
using survey_beta.DTOs.Default;
|
|
using survey_beta.Models;
|
|
|
|
namespace survey_beta.Mappers
|
|
{
|
|
public class ChoiceMapper
|
|
{
|
|
public static ChoiceDto ToDto(Choice choice)
|
|
{
|
|
return new ChoiceDto
|
|
{
|
|
Id = choice.Id,
|
|
Letter = choice.Letter,
|
|
Content = choice.Content,
|
|
QuestionId = choice.QuestionId
|
|
};
|
|
}
|
|
|
|
public static Choice ToEntity(CreateChoiceDto dto)
|
|
{
|
|
return new Choice
|
|
{
|
|
Id = Guid.NewGuid().ToString(),
|
|
Letter = dto.Letter,
|
|
Content = dto.Content,
|
|
};
|
|
}
|
|
}
|
|
}
|