Esempio n. 1
0
        public ActionResult DeleteConfirmed(long id)
        {
            Device device = db.Devices.Find(id);

            db.Devices.Remove(device);
            db.SaveChanges();

            // Remove the specified device from IoT Hub
            var task = Task.Run(async() =>
            {
                await DeviceManagement.RemoveDeviceAsync(device.DeviceId);
            });

            task.Wait();

            return(RedirectToAction("Index"));
        }