Пример #1
0
        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);
        }
Пример #2
0
        public async Task <IActionResult> SetDeviceInfo(int DeviceId, ADeviceInfo aDeviceInfo)
        {
            try
            {
                await _testConnectionService.SetDeviceInfo(DeviceId, aDeviceInfo);

                return(Json(true));
            }
            catch (Exception ex)
            {
                return(Json(false));
            }
        }