Ejemplo n.º 1
0
        public static void GetAllGroups()
        {
            var service = new PowerBIService.Services.Implementation.PowerService();
            var dd      = Task.Run(async() => await service.GetAllGroups(new UserData
            {
                TenantId      = TenantId,
                SecretId      = SecretId,
                ApplicationId = ApplicationId
            })).ConfigureAwait(false);
            var result = dd.GetAwaiter().GetResult();

            foreach (var group in result)
            {
                Console.WriteLine($"{group.Name}->{group.Id}");
            }


            Console.WriteLine("Hello World!");
        }
Ejemplo n.º 2
0
        public ActionResult Index()
        {
            ViewBag.Title = "Home Page";

            var service = new PowerBIService.Services.Implementation.PowerService();
            var groups  = Task.Run(async() => await service.GetAllGroups(Credential)).ConfigureAwait(false);
            var data    = groups.GetAwaiter().GetResult();
            var list    = new List <SelectListItem>();

            data.ForEach(s =>
            {
                list.Add(new SelectListItem {
                    Value = s.Id, Text = s.Name
                });
            });
            var dataVm = new GroupsVM {
                GroupFromList = list.ToArray(), GroupToList = list.ToArray(), GroupEmebdList = list.ToArray()
            };

            return(View(dataVm));
        }