public List <DeviceModelModel> GetModels() { List <DeviceModelModel> devicesTypes = deviceModelDataService.GetDeviceModels() .Select(mapper.Map <DeviceModel, DeviceModelModel>) .ToList(); return(devicesTypes); }
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); }