public async Task <GetMachineForViewDto> GetMachineForView(int id) { var machine = await _machineRepository.GetAsync(id); var output = new GetMachineForViewDto { Machine = ObjectMapper.Map <MachineDto>(machine) }; return(output); }
public async Task <GetMachineForViewDto> GetMachineForView(int id) { var machine = await _machineRepository.GetAsync(id); var output = new GetMachineForViewDto { Machine = ObjectMapper.Map <MachineDto>(machine) }; if (output.Machine.OrganizationUnitId != null) { var _lookupOrganizationUnit = await _lookup_organizationUnitRepository.FirstOrDefaultAsync((long)output.Machine.OrganizationUnitId); output.OrganizationUnitDisplayName = _lookupOrganizationUnit.DisplayName.ToString(); } return(output); }