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/ContentLessonMapper.cs

34 lines
1010 B

using Dto;
using Entities;
using ModelToEntities.Business;
namespace Shared.Mapper;
public static class ContentLessonMapper
{
public static ContentLesson FromDTOToModel(this ContentLessonDTO dto)
{
return new ContentLesson(dto.LessonId, dto.LessonPartId);
}
public static ContentLesson FromEntityToModel(this ContentLessonEntity ent)
{
return new ContentLesson(ent.LessonId, ent.LessonPartId);
}
public static ContentLessonDTO FromModelToDTO(this ContentLesson les)
{
return new ContentLessonDTO(les.LessonId, les.LessonPartId);
}
public static ContentLessonDTO FromEntityToDTO(this ContentLessonEntity ent)
{
return new ContentLessonDTO(ent.LessonId, ent.LessonPartId);
}
public static ContentLessonEntity FromModelToEntity(this ContentLesson les)
{
return new ContentLessonEntity(les.LessonId, new LessonEntity(les.LessonId), les.LessonPartId,
new ParagraphEntity(les.LessonPartId));
}
}