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

44 lines
1.5 KiB

using Dto;
using Entities;
using ModelToEntities.Business;
namespace Shared.Mapper;
public static class InquiryMapper
{
public static Inquiry FromDTOToModel(this InquiryDTO InqDto)
{
return new Inquiry(InqDto.Id, InqDto.Title, InqDto.Description, InqDto.IsUser, InqDto.Database,
InqDto.InquiryTable);
}
public static Inquiry FromEntityToModel(this InquiryEntity InqEntity)
{
return new Inquiry(InqEntity.Id, InqEntity.Title, InqEntity.Description, InqEntity.IsUser,
InqEntity.Database.OwnerId, InqEntity.Solution.OwnerId);
}
public static InquiryEntity FromModelToEntity(this Inquiry Inq)
{
return new InquiryEntity(Inq.Id, Inq.Title, Inq.Description, Inq.IsUser, new InquiryTableEntity(Inq.Database),
new SolutionEntity(Inq.InquiryTable));
}
public static InquiryEntity FromDTOToEntity(this InquiryDTO InqDto)
{
return new InquiryEntity(InqDto.Id, InqDto.Title, InqDto.Description, InqDto.IsUser,
new InquiryTableEntity(InqDto.Database), new SolutionEntity(InqDto.InquiryTable));
}
public static InquiryDTO FromModelToDTO(this Inquiry Inq)
{
return new InquiryDTO(Inq.Id, Inq.Title, Inq.Description, Inq.IsUser, Inq.Database, Inq.InquiryTable);
}
public static InquiryDTO FromEntityToDTO(this InquiryEntity InqEntity)
{
return new InquiryDTO(InqEntity.Id, InqEntity.Title, InqEntity.Description, InqEntity.IsUser,
InqEntity.Database.OwnerId, InqEntity.Solution.OwnerId);
}
}