public async Task <bool> SetDeviceInfo(int deviceId, ADeviceInfo aDeviceInfo) { var device = await dbContext.Device.SingleAsync(x => x.Id == deviceId); HttpClient client = await GetHttpClient(device.Ip); var response = await client.PostAsync("info", await DataToStringContent(aDeviceInfo)); return(true); }
public async Task <IActionResult> SetDeviceInfo(int DeviceId, ADeviceInfo aDeviceInfo) { try { await _testConnectionService.SetDeviceInfo(DeviceId, aDeviceInfo); return(Json(true)); } catch (Exception ex) { return(Json(false)); } }