由于asp.net会员资格不允许通过用户名和电子邮件同时搜索,我认为我应该合并这两个分页结果集的结果。
以前有人这样做过吗? 或者这是无法实现的想法?
“合并”方法的FYI签名:
MembershipUserCollection FindUsersByName( string usernameToMatch,
int pageIndex,
int pageSize,
out int totalRecords )
MembershipUserCollection FindUsersByEmail( string emailToMatch,
int pageIndex,
int pageSize,
out int totalRecords )
结果方法签名应该是:
MembershipUserCollection MergedUsersAndEmailsSearch( string userOrEmailToMatch,
int pageIndex,
int pageSize,
out int totalRecords )
{
//here we calling FindUsersByName and FindUsersByEmail and merging them
}
答案 0 :(得分:0)
有效吗?
collection1 = FindUsersByName(...);
collection2 = FindUsersByEmail(...);
collection1.ToList().AddRange(collection2.ToList());