Hi guys. I guess this is trivial but not for me.
I have a collection MembershipUserCollection
. I wanted to perform some Linq query over it so I've used OfType<MembershipUser>()
method and then applied Where()
on it. However, I do not know how to cast back my results to MembershipUserCollection
?
This is my code:
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)
is returning MembershipUserCollection
Thanks for your time.