private ContainerTypeDTO Map(tblContainerType tbl) { var dto = new ContainerTypeDTO { MasterId = tbl.Id, DateCreated = tbl.IM_DateCreated, DateLastUpdated = tbl.IM_DateLastUpdated, StatusId = tbl.IM_Status, Name = tbl.Name, Make = tbl.Make, Code = tbl.Code, Description = tbl.Description, Model = tbl.Model, LoadCariage = tbl.LoadCariage ?? 0, TareWeight = tbl.TareWeight ?? 0, Lenght = tbl.Lenght ?? 0, Width = tbl.Width ?? 0, Height = tbl.Height ?? 0, BubbleSpace = tbl.BubbleSpace ?? 0, Volume = tbl.Volume ?? 0, FreezerTemp = tbl.FreezerTemp ?? 0, CommodityGradeId = tbl.CommodityGradeId ?? Guid.Empty, ContainerUseTypeId = tbl.ContainerUseId ?? 0 }; return dto; }
public ContainerType Map(ContainerTypeDTO dto) { if (dto == null) return null; var containerType = Mapper.Map<ContainerTypeDTO, ContainerType>(dto); containerType.CommodityGrade = dto.CommodityGradeId != Guid.Empty ? _commodityRepository.GetGradeByGradeId(dto.CommodityGradeId) : null; return containerType; }