我想這是微不足道的,但不適合我。我的收藏MembershipUserCollection
。我想對它執行一些Linq查詢,所以我使用OfType<MembershipUser>()
方法,然後在其上應用Where()
。但是,我不知道如何將我的結果投回到MembershipUserCollection
?將LinQ結果強制類型化集合的問題
這是我的代碼:
MembershipUserCollection Users;
Users = GetAllUsers(pageIndex, pageSize, out totalRecords).OfType<MembershipUser>().Where(user => user.Email == emailToMatch); //how to cast it back to MembershipUserCollection ?
GetAllUsers(pageIndex, pageSize, out totalRecords)
正在恢復MembershipUserCollection
感謝您的時間。
謝謝,編譯器說有一個表達式。 – Wodzu 2010-10-22 10:13:30