草庐IT

MembershipUserCollection

全部标签

c# - 在 MembershipUserCollection 上使用 Linq

我有这段代码,它通过使用我的成员(member)提供程序为我提供了所有用户的列表。varusers=Membership.GetAllUsers();varusernames=newList();foreach(MembershipUserminusers)usernames.Add(m.UserName);我认为使用LINQ应该有更简单的方法来执行此操作,但我似乎无法在MembershipUserCollection上使用LINQ 最佳答案 因为MembershipUserCollection只实现了IEnumerable,不是I