In an ASP.NET Core 1.1 app with Individual User Accounts
authentication, I'm trying to display a dropdown
of Users
in an ascending order. But the VS2015
's Intellisense
does not recognize the .OrderBy(u => u.Value)
of the code below. Why is that?. I then end up using OrderBy on the `.Select(u => new SelectListItem { Value = u.UserName, Text = u.UserName }) that, as expected, works. [Ref: UserManager class]
public IActionResult GetUserList()
{
var UserListVM = new UsetListViewModel()
{
UserList = _userManager.Users.OrderBy(u => u.Value).Select(u => new SelectListItem { Value = u.UserName, Text = u.UserName }).ToList()
};
return View(UserListVM);
}