private SourcingContainerDTO Map(tblEquipment tbl)
 {
     var dto = new SourcingContainerDTO
                   {
                       MasterId = tbl.Id,
                       DateCreated = tbl.IM_DateCreated,
                       DateLastUpdated = tbl.IM_DateLastUpdated,
                       StatusId = tbl.IM_Status,
                       Name = tbl.Name,
                       Code = tbl.Code,
                       Description = tbl.Description,
                       EquipmentNumber = tbl.EquipmentNumber,
                       EquipmentTypeId = tbl.EquipmentType,
                       HubId = tbl.CostCentreId,
                       Make = tbl.Make,
                       Model = tbl.Model,
                       ContainerTypeId = tbl.ContainerTypeId ?? Guid.Empty
                   };
     return dto;
 }
Пример #2
0
 public SourcingContainer Map(SourcingContainerDTO dto)
 {
     if (dto == null) return null;
     var container = Mapper.Map<SourcingContainerDTO, SourcingContainer>(dto);
     container.CostCentre = _hubRepository.GetById(dto.HubId) as Hub;
     container.ContainerType = _containerTypeRepository.GetById(dto.ContainerTypeId);
     return container;
 }