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/Model/Mappers/LessonMapper.cs

46 lines
1.3 KiB

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Entities.SQLuedoDB;
using Model.Business;
using Model.DTO;
namespace Model.Mappers
{
public static class LessonMapper
{
public static LessonDTO FromModelToDTO(Lesson model)
{
return new LessonDTO(model.Id, model.Title, model.LastPublisher, model.LastEdit);
}
public static LessonDTO FromEntityToDTO(LessonEntity model)
{
return new LessonDTO(model.Id, model.Title, model.LastPublisher, model.LastEdit);
}
public static LessonEntity FromModelToEntity(Lesson model)
{
return new LessonEntity(model.Id, model.Title, model.LastPublisher, model.LastEdit);
}
public static LessonEntity FromDTOToEntity(LessonDTO dto)
{
return new LessonEntity(dto.Id, dto.Title, dto.LastPublisher, dto.LastEdit);
}
public static Lesson FromDTOToModel(LessonDTO dto)
{
return new Lesson(dto.Id, dto.Title, dto.LastPublisher, dto.LastEdit);
}
public static Lesson FromEntityToModel(LessonEntity entity)
{
return new Lesson(entity.Id, entity.Title, entity.LastPublisher, entity.LastEdit);
}
}
}