当我尝试“选择列表”时,SelectList不起作用

时间:2018-11-03 11:50:39

标签: asp.net

我正在尝试生成一个选择列表,该选择列表从所有者列表中构造了被阻止的用户。我究竟做错了什么?

var ownerlist = (new SelectList(_userManager.GetUsersInRoleAsync("Owner").Result, "Id", "Fullname")).OrderBy(x =>x.Value);

var blockedUsers = (new SelectList(_userManager.Users.Where(u => u.UserAccountIsBlocked == UserAccountIsBlocked.Yes), "Id", "Fullname")).OrderBy(x => x.Value);

var list = ownerlist.Except(blockedUsers);

0 个答案:

没有答案