Прочетете на английски Редактиране

Споделяне чрез


ClaimSet.FindClaims(String, String) Method

Definition

When overridden in a derived class, searches for a Claim object that matches the specified claim type and rights in the ClaimSet.

C#
public abstract System.Collections.Generic.IEnumerable<System.IdentityModel.Claims.Claim> FindClaims(string claimType, string right);

Parameters

claimType
String

The uniform resource identifier (URI) of a claim type. Several claim types are available as static properties of the ClaimTypes class.

right
String

The URI of the right associated with the new claim. Several rights are available as static properties of the Rights class.

Returns

A IEnumerable<T> of type Claim that enables you to enumerate the claims that matches the specified criteria.

Examples

C#
// Iterate through claims of type "http://example.org/claims/allowedoperation".
foreach (Claim c in cs.FindClaims("http://example.org/claims/allowedoperation",
    Rights.PossessProperty))
{

Remarks

To determine if this ClaimSet contains the claim without returning the claim, call the ContainsClaim method.

Applies to

Продукт Версии
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided)