MembershipUser BuildMembershipUser (DbCommand query, string username, object userId)
{
try {
using (DbConnection connection = CreateConnection ()) {
query.Connection = connection;
using (DbDataReader reader = query.ExecuteReader ()) {
if (!reader.Read ())
return null;
return GetUserFromReader (reader, username, userId);
}
}
} catch (Exception) {
return null; /* should we let the exception through? */
}
finally {
query.Connection = null;
}
}