Example #1
0
        public async Task <IActionResult> Index()
        {
            using (var graph = new GraphRepository(await HttpContext.GetTokenAsync("access_token")))
            {
                var devices = await graph.GetDevicesAsync();

                return(View(new DeviceSelectPageViewModel
                {
                    Devices = devices.Select(x => new SelectListItem
                    {
                        Text = $"{x.Name}({x.Platform})",
                        Value = x.Id,
                    }),
                }));
            }
        }