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.
40 lines
1.2 KiB
40 lines
1.2 KiB
using Dto;
|
|
using Entities;
|
|
using ModelToEntities.Business;
|
|
|
|
namespace Shared.Mapper;
|
|
|
|
public static class SuccessMapper
|
|
{
|
|
public static Success FromDTOToModel(this SuccessDTO dto)
|
|
{
|
|
return new Success(dto.UserId, dto.InquiryId, dto.IsFinished);
|
|
}
|
|
|
|
public static Success FromEntityToModel(this SuccessEntity ent)
|
|
{
|
|
return new Success(ent.UserId, ent.InquiryId, ent.IsFinished);
|
|
}
|
|
|
|
public static SuccessDTO FromModelToDTO(this Success suc)
|
|
{
|
|
return new SuccessDTO(suc.UserId, suc.InquiryId, suc.IsFinished);
|
|
}
|
|
|
|
public static SuccessDTO FromEntityToDTO(this SuccessEntity ent)
|
|
{
|
|
return new SuccessDTO(ent.UserId, ent.InquiryId, ent.IsFinished);
|
|
}
|
|
|
|
public static SuccessEntity FromDTOToEntity(this SuccessDTO dto)
|
|
{
|
|
return new SuccessEntity(dto.UserId, new UserEntity(dto.UserId), dto.InquiryId,
|
|
new InquiryEntity(dto.InquiryId), dto.IsFinished);
|
|
}
|
|
|
|
public static SuccessEntity FromModelToEntity(this Success suc)
|
|
{
|
|
return new SuccessEntity(suc.UserId, new UserEntity(suc.UserId), suc.InquiryId,
|
|
new InquiryEntity(suc.InquiryId), suc.IsFinished);
|
|
}
|
|
} |