public List <DeviceTypeModel> GetDeviceTypes() { List <DeviceTypeModel> devicesTypes = deviceTypeDataService.GetDeviceTypes() .Select(mapper.Map <DeviceType, DeviceTypeModel>) .OrderBy(x => x.DisplayName) .ToList(); return(devicesTypes); }
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); }