Gets the repository id of a user where the e-mail address matches the specified e-mail address.
Namespace:
Novalys.VisualGuard.Security.MembershipAssembly: Novalys.VisualGuard.Security (in Novalys.VisualGuard.Security.dll) Version: 3.2.912.1 (3.2.912.01)
Syntax
| C# |
|---|
public static string GetUserIdByEmail( string emailToMatch ) |
| Visual Basic (Declaration) |
|---|
Public Shared Function GetUserIdByEmail ( _ emailToMatch As String _ ) As String |
Parameters
- emailToMatch
- Type: System..::.String
The e-mail address to search for.
Return Value
The repository id of the user where the e-mail address for the user matches the specified e-mail address. If no match is found, a null reference (Nothing in Visual Basic) is returned.
Remarks
GetUserIdByEmail(String) can be used to retrieve the user name for a membership user in the case where a user does not know their user name, but does know their e-mail address. If more than one user in the data store has the same e-mail address, the first user name encountered is returned.
Leading and trailing spaces are trimmed from all parameter values.
Exceptions
| Exception | Condition |
|---|---|
| System..::.ArgumentNullException | emailToMatch is null. |
| System..::.ArgumentException | emailToMatch is empty or longer than 64 characters after trimming. |