public List <HardwareDto> GetHardwareDtosByProjectID(int ProjectID)
        {
            List <HardwareDto> hardwareDtos = new List <HardwareDto>();
            var hardwares = _hardwareRepository.GetEntitiesByProjectID(ProjectID);

            //转换Domain为Dto
            foreach (var hardware in hardwares)
            {
                HardwareDto hardwareDto = new HardwareDto();
                hardwareDto.ID         = hardware.ID;
                hardwareDto.Name       = hardware.Name;
                hardwareDto.Number     = hardware.Number;
                hardwareDto.CreateTime = hardware.CreateTime;
                hardwareDto.CreateUser = hardware.CreateUser;
                //将项目ID转化为对应项目名
                var projects = _projectRepository.GetAllEntities();
                foreach (var project in projects)
                {
                    if (project.ID == hardware.ProjectID)
                    {
                        hardwareDto.Project = project.Name;
                    }
                }
                hardwareDtos.Add(hardwareDto);
            }
            return(hardwareDtos);
        }