ClaimsIdentity.FindFirst Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Retrieves the first claim that matches a specified condition.
Overloads
FindFirst(Predicate<Claim>) |
Retrieves the first claim that is matched by the specified predicate. |
FindFirst(String) |
Retrieves the first claim with the specified claim type. |
FindFirst(Predicate<Claim>)
- Source:
- ClaimsIdentity.cs
- Source:
- ClaimsIdentity.cs
- Source:
- ClaimsIdentity.cs
Retrieves the first claim that is matched by the specified predicate.
public:
virtual System::Security::Claims::Claim ^ FindFirst(Predicate<System::Security::Claims::Claim ^> ^ match);
public virtual System.Security.Claims.Claim FindFirst (Predicate<System.Security.Claims.Claim> match);
public virtual System.Security.Claims.Claim? FindFirst (Predicate<System.Security.Claims.Claim> match);
abstract member FindFirst : Predicate<System.Security.Claims.Claim> -> System.Security.Claims.Claim
override this.FindFirst : Predicate<System.Security.Claims.Claim> -> System.Security.Claims.Claim
Public Overridable Function FindFirst (match As Predicate(Of Claim)) As Claim
Parameters
Returns
The first matching claim or null
if no match is found.
Exceptions
match
is null
.
Applies to
FindFirst(String)
- Source:
- ClaimsIdentity.cs
- Source:
- ClaimsIdentity.cs
- Source:
- ClaimsIdentity.cs
Retrieves the first claim with the specified claim type.
public:
virtual System::Security::Claims::Claim ^ FindFirst(System::String ^ type);
public virtual System.Security.Claims.Claim FindFirst (string type);
public virtual System.Security.Claims.Claim? FindFirst (string type);
abstract member FindFirst : string -> System.Security.Claims.Claim
override this.FindFirst : string -> System.Security.Claims.Claim
Public Overridable Function FindFirst (type As String) As Claim
Parameters
- type
- String
The claim type to match.
Returns
The first matching claim or null
if no match is found.
Exceptions
type
is null
.
Remarks
The comparison is done in StringComparison.OrdinalIgnoreCase mode.