if (document.body.clientWidth < 500) {
const margin = 20;
$('.b').width($(window).width() - margin * 2).css('left', function() {
return `-${$(this).parent().offset().left - margin}px`
});
}
else{
$(' .b').css( "width", "70px" );
}
public class UsersViewModel
{
public string Id { get; set; }
public string Login { get; set; }
public string Email { get; set; }
public string Role_Id { get; set; }
public string Role_Name { get; set; }
public bool LockoutAcount { get; set; }
}
public async Task <ActionResult> GetUsers()
{
var users = UserManager.Users.ToList();
var roles = RoleManager.Roles.ToList();
List<RolesViewModel> RolesList = new List<RolesViewModel>();
for (int i = 0; i < roles.Count(); i++)
{
RolesList.Add(new RolesViewModel { Id = roles[i].Id, Name = roles[i].Name });
}
List<UsersViewModel> UsersList = new List<UsersViewModel>();
for(int i = 0; i < users.Count(); i++)
{
var temp = await UserManager.GetRolesAsync(users[i].Id);
var item = temp.FirstOrDefault();
UsersList.Add(new UsersViewModel { Id = users[i].Id, Login = users[i].UserName, Email = users[i].Email, LockoutAcount = users[i].LockoutEnabled, Role_Name = item });
}
return View(UsersList);
}
@model List<UsersViewModel>
<div>@Model[0].Email </div>