public Centre Map(CentreDTO dto) { if (dto == null) return null; var centre = Mapper.Map<CentreDTO, Centre>(dto); centre.CenterType = _centreTypeRepository.GetById(dto.CenterTypeId); centre.Route = _routeRepository.GetById(dto.RouteId); centre.Hub = _costCentreRepository.GetById(dto.HubId) as Hub; return centre; }
private CentreDTO Map(tblCentre tbl) { var dto = new CentreDTO { MasterId = tbl.Id, DateCreated = tbl.IM_DateCreated, DateLastUpdated = tbl.IM_DateLastUpdated, StatusId = tbl.IM_Status, Code = tbl.Code, Name = tbl.Name, Description = tbl.Description, CenterTypeId = tbl.CentreTypeId, HubId = tbl.HubId, RouteId = tbl.RouteId ?? Guid.Empty }; return dto; }