Exemplo n.º 1
0
 public void SetRoleItems(IEnumerable <IdentityRole> roles)
 {
     foreach (var role in roles)
     {
         RoleItems.Add(new SelectListItem()
         {
             Value = role.Id.ToString(),
             Text  = role.Name
         });
     }
 }
Exemplo n.º 2
0
        protected override async Task OnInitializedAsync()
        {
            await base.OnInitializedAsync();

            var result = await Http.GetFromJsonAsync <PagedResultDto <UserDto> >("/api/base/user");

            var roles = await GetRoleListAsync();

            Items = result.Items;
            foreach (var role in roles)
            {
                RoleItems.Add(new SelectedItem
                {
                    Text  = role.Name,
                    Value = role.Name
                });
            }
        }