public override MembershipUserCollection FindUsersByEmail(
string emailToMatch, int pageIndex, int pageSize, out int totalRecords)
{
Condition.Requires(emailToMatch, "emailToMatch").IsNotNullOrWhiteSpace();
Condition.Requires(pageIndex, "pageIndex").IsNotLessThan(0);
Condition.Requires(pageSize, "pageSize").IsGreaterOrEqual(1);
if (!this.HasEmailColumnDefined)
{
throw new ProviderException("userEmailColumn is not defined");
}
var startRow = GetPagingStartRow(pageIndex, pageSize);
using (var db = this.ConnectToDatabase())
{
emailToMatch = AppendWildcardToSearchTerm(emailToMatch);
var rows = db.Query(this.sqlQueryBuilder.FindUsersByEmail, startRow, pageSize, emailToMatch).ToList();
return this.ExtractMembershipUsersFromRows(rows, out totalRecords);
}
}