|
|
|
@ -0,0 +1,44 @@
|
|
|
|
|
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);
|
|
|
|
|
}
|
|
|
|
|
}
|