예제 #1
0
        public async Task <GetMachineForViewDto> GetMachineForView(int id)
        {
            var machine = await _machineRepository.GetAsync(id);

            var output = new GetMachineForViewDto {
                Machine = ObjectMapper.Map <MachineDto>(machine)
            };

            return(output);
        }
예제 #2
0
        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);
        }