32 lines
1.1 KiB
C#

using Marco.Pms.Model.Dtos.Master;
using Marco.Pms.Model.Master;
using Marco.Pms.Model.ViewModels.Master;
namespace Marco.Pms.Model.Mapper
{
public static class MasterMapper
{
// -------------------------------- Work Category --------------------------------
public static WorkCategoryMaster ToWorkCategoryMasterFromWorkCategoryMasterDto(this WorkCategoryMasterDto categoryMasterDto, Guid tenantId)
{
return new WorkCategoryMaster
{
Id = categoryMasterDto.Id ?? Guid.Empty,
Name = categoryMasterDto.Name,
Description = categoryMasterDto.Description ?? "",
TenantId = tenantId
};
}
public static WorkCategoryMasterVM ToWorkCategoryMasterVMFromWorkCategoryMaster(this WorkCategoryMaster categoryMaster)
{
return new WorkCategoryMasterVM
{
Id = categoryMaster.Id,
Name = categoryMaster.Name,
Description = categoryMaster.Description ?? "",
IsSystem = categoryMaster.IsSystem
};
}
}
}