示例#1
0
        public async Task <IEnumerable <AdminUserListingModel> > All()
        {
            var users = new List <AdminUserListingModel>();

            foreach (var u in this.db.Users)
            {
                var boola = await _userManager.IsInRoleAsync(u, "Administrator");

                var user = new AdminUserListingModel
                {
                    Name     = u.Name,
                    Username = u.UserName,
                    Email    = u.Email,
                    Id       = u.Id,
                };
                user.IsInRole = boola;
                users.Add(user);
            }
            return(users.OrderBy(u => u.Username));
        }
示例#2
0
 public static string ToHtml(this AdminUserListingModel user)
 => $@"