i'm sorry guys it's stupid commit...
This commit is contained in:
parent
77cfacb95e
commit
4b4739ce89
13 changed files with 174 additions and 1 deletions
21
SurveyBackend/SurveyBackend.API/Mappers/CompletionMapper.cs
Normal file
21
SurveyBackend/SurveyBackend.API/Mappers/CompletionMapper.cs
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
using SurveyBackend.DTOs.Completion;
|
||||
using SurveyLib.Core.Models;
|
||||
|
||||
namespace SurveyBackend.Mappers;
|
||||
|
||||
public static class CompletionMapper
|
||||
{
|
||||
public static Completion CreateDtoToModel(CompletionCreateDto dto, int surveyId, int? performerId) => new Completion
|
||||
{
|
||||
SurveyId = surveyId,
|
||||
CompletedBy = performerId,
|
||||
Answers = dto.Answers.Select(AnswerMapper.CreateDtoToModel).ToList(),
|
||||
};
|
||||
|
||||
public static CompletionOutputDto ModelToOutputDto(Completion model) => new CompletionOutputDto
|
||||
{
|
||||
CompletedBy = model.CompletedBy,
|
||||
FinishedAt = model.FinishedAt,
|
||||
Answers = model.Answers.Select(AnswerMapper.ModelToOutputDto).ToList(),
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue