示例#1
0
        public List <DeviceTypeModel> GetDeviceTypes()
        {
            List <DeviceTypeModel> devicesTypes = deviceTypeDataService.GetDeviceTypes()
                                                  .Select(mapper.Map <DeviceType, DeviceTypeModel>)
                                                  .OrderBy(x => x.DisplayName)
                                                  .ToList();

            return(devicesTypes);
        }
示例#2
0
        public IEnumerable <Protocol> GetProtocols()
        {
            if (protocols == null)
            {
                protocols = deviceTypeDataService.GetDeviceTypes()
                            .GroupBy(x => x.Protocol)
                            .Select(x => x.Key)
                            .OrderBy(x => x.Name)
                            .ThenBy(x => x.Port)
                            .ToArray();
            }

            return(protocols);
        }