using SurveyBackend.DTOs.Survey; using SurveyLib.Core.Models; namespace SurveyBackend.Mappers; /// /// Маппер всего про опросы /// public static class SurveyMapper { /// /// Схема создания в модель /// /// /// /// public static Survey CreateDtoToModel(SurveyCreateDto dto, int userId) { return new Survey { Title = dto.Title, Description = dto.Description, CreatedBy = userId }; } public static Survey UpdateDtoToModel(SurveyUpdateDto dto, int userId, int surveyId) => new Survey { Id = surveyId, Title = dto.Title, Description = dto.Description, CreatedBy = userId }; /// /// Модель в выходную схему /// /// /// public static SurveyOutputDto ModelToOutputDto(Survey survey) { return new SurveyOutputDto { Id = survey.Id, Title = survey.Title, Description = survey.Description, CreatedBy = survey.CreatedBy, }; } }