Refactored DTOs to use AutoMapper instead of manual mapping and made some additional improvements and fixes.
Added : GetAllSurveys&DeleteUser.
This commit is contained in:
2025-02-07 06:40:57 -08:00
parent 272ef7194e
commit 3aabe1a367
214 changed files with 10555 additions and 262 deletions

View File

@@ -0,0 +1,22 @@
using AutoMapper;
using survey_beta.DTOs.Create;
using survey_beta.DTOs.Default;
using survey_beta.DTOs.Response;
using survey_beta.DTOs.Update;
using survey_beta.Models;
public class MappingProfile : Profile
{
public MappingProfile()
{
CreateMap<CreateSurveyDto, Survey>().ForMember(dest => dest.Id, opt => opt.Ignore());
CreateMap<CreateQuestionDto, Question>().ForMember(dest => dest.Id, opt => opt.Ignore());
CreateMap<CreateChoiceDto, Choice>().ForMember(dest => dest.Id, opt => opt.Ignore());
CreateMap<Survey, SurveyDto>();
CreateMap<Question, QuestionDto>();
CreateMap<Choice, ChoiceDto>();
CreateMap<UpdateSurveyDto, Survey>();
}
}