public ActionResult <string> TVChannel(string DeviceName) { try { using (var db = new Model.DeviceChannels()) { //DeviceJSON returnVals = new DeviceJSON(); var device = db.Devices.Where(d => d.DeviceName.Contains(DeviceName)); if (device.SingleOrDefault().SetChannel == 0) { return("Not Set"); } //old: int SelectChannel = device.SingleOrDefault().SetChannel; return(NameResolver.IDToURL(SelectChannel)); } } catch { return("NaN"); } }