コード例 #1
0
        public List <DeviceModelModel> GetModels()
        {
            List <DeviceModelModel> devicesTypes = deviceModelDataService.GetDeviceModels()
                                                   .Select(mapper.Map <DeviceModel, DeviceModelModel>)
                                                   .ToList();

            return(devicesTypes);
        }
コード例 #2
0
        public Protocol[] GetProtocols()
        {
            if (protocols == null)
            {
                protocols = deviceModelDataService.GetDeviceModels()
                            .GroupBy(x => new { x.Protocol, x.Port })
                            .Select(x => new Protocol
                {
                    Name = x.Key.Protocol,
                    Port = x.Key.Port
                })
                            .OrderBy(x => x.Name)
                            .ThenBy(x => x.Port)
                            .ToArray();
            }

            return(protocols);
        }