You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
API_SQLuedo/API_SQLuedo/Shared/Mapper/ParagraphMapper.cs

42 lines
1.4 KiB

using Dto;
using Entities;
using Model;
namespace Shared.Mapper;
public static class ParagraphMapper
{
public static Paragraph FromDTOToModel(this ParagraphDTO dto)
{
return new Paragraph(dto.ContentTitle, dto.ContentContent, dto.Info, dto.Query, dto.Comment);
}
public static Paragraph FromEntityToModel(this ParagraphEntity model)
{
return new Paragraph(model.ContentTitle, model.ContentContent, model.Info, model.Query, model.Comment);
}
public static ParagraphDTO FromEntityToDTO(this ParagraphEntity model)
{
return new ParagraphDTO(model.Id, model.ContentTitle, model.ContentContent, model.Info, model.Query,
model.Comment, model.LessonId);
}
public static ParagraphDTO FromModelToDTO(this Paragraph model)
{
return new ParagraphDTO(model.Id, model.ContentTitle, model.ContentContent, model.Info, model.Query,
model.Comment, model.LessonId);
}
public static ParagraphEntity FromDTOToEntity(this ParagraphDTO dto)
{
return new ParagraphEntity(dto.Id, dto.ContentTitle, dto.ContentContent, dto.Info, dto.Query, dto.Comment,
dto.LessonId);
}
public static ParagraphEntity FromModelToEntity(this Paragraph model)
{
return new ParagraphEntity(model.Id, model.ContentTitle, model.ContentContent, model.Info, model.Query,
model.Comment, model.LessonId);
}
}