public async Task <HttpResponseMessage> GetDeviceKeysAsync(string id)
 {
     return(await GetServiceResponseAsync <SecurityKeys>(async() =>
     {
         return await _deviceLogic.GetIoTHubKeysAsync(id);
     }));
 }
Ejemplo n.º 2
0
        public async Task <HttpResponseMessage> GetDeviceKeysAsync(string id)
        {
            ValidateArgumentNotNullOrWhitespace("id", id);

            return(await GetServiceResponseAsync <SecurityKeys>(async() =>
            {
                return await _deviceLogic.GetIoTHubKeysAsync(id);
            }));
        }
        public async Task <ActionResult> GetDeviceKeys(string deviceId)
        {
            var keys = await _deviceLogic.GetIoTHubKeysAsync(deviceId);

            var keysModel = new SecurityKeysModel
            {
                PrimaryKey   = keys != null ? keys.PrimaryKey : Strings.DeviceNotRegisteredInIoTHub,
                SecondaryKey = keys != null ? keys.SecondaryKey : Strings.DeviceNotRegisteredInIoTHub
            };

            return(PartialView("_DeviceDetailsKeys", keysModel));
        }