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

44 lines
1.6 KiB

using Dto;
using Entities;
using ModelToEntities.Business;
namespace Shared.Mapper;
public static class SolutionMapper
{
public static Solution FromDTOToModel(this SolutionDTO dto)
{
return new Solution(dto.OwnerId, dto.MurdererFirstName, dto.MurdererLastName, dto.MurderPlace, dto.MurderWeapon,
dto.Explanation);
}
public static Solution FromEntityToModel(this SolutionEntity entity)
{
return new Solution(entity.OwnerId, entity.MurdererFirstName, entity.MurdererLastName, entity.MurderPlace,
entity.MurderWeapon, entity.Explanation);
}
public static SolutionDTO FromModelToDTO(this Solution model)
{
return new SolutionDTO(model.OwnerId, model.MurdererFirstName, model.MurdererLastName, model.MurderPlace,
model.MurderWeapon, model.Explanation);
}
public static SolutionDTO FromEntityToDTO(this SolutionEntity entity)
{
return new SolutionDTO(entity.OwnerId, entity.MurdererFirstName, entity.MurdererLastName, entity.MurderPlace,
entity.MurderWeapon, entity.Explanation);
}
public static SolutionEntity FromModelToEntity(this Solution model)
{
return new SolutionEntity(model.OwnerId, new InquiryEntity(model.OwnerId), model.MurdererFirstName,
model.MurdererLastName, model.MurderPlace, model.MurderWeapon, model.Explanation);
}
public static SolutionEntity FromDTOToEntity(this SolutionDTO dto)
{
return new SolutionEntity(dto.OwnerId, new InquiryEntity(dto.OwnerId), dto.MurdererFirstName,
dto.MurdererLastName, dto.MurderPlace, dto.MurderWeapon, dto.Explanation);
}
}