Claim.Clone Method

Definition

Returns a new Claim object copied from this object.

Overloads

Clone(ClaimsIdentity)

Returns a new Claim object copied from this object. The subject of the new claim is set to the specified ClaimsIdentity.

Clone()

Returns a new Claim object copied from this object. The new claim does not have a subject.

Clone(ClaimsIdentity)

Source:
Claim.cs
Source:
Claim.cs
Source:
Claim.cs

Returns a new Claim object copied from this object. The subject of the new claim is set to the specified ClaimsIdentity.

C#
public virtual System.Security.Claims.Claim Clone(System.Security.Claims.ClaimsIdentity identity);
C#
public virtual System.Security.Claims.Claim Clone(System.Security.Claims.ClaimsIdentity? identity);

Parameters

identity
ClaimsIdentity

The intended subject of the new claim.

Returns

The new claim object.

Remarks

This is a shallow copy operation. The Subject property of the new Claim object is set to the value of the identity parameter.

Applies to

.NET 10 and other versions
Product Versions
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 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, 2.1
UWP 10.0

Clone()

Source:
Claim.cs
Source:
Claim.cs
Source:
Claim.cs

Returns a new Claim object copied from this object. The new claim does not have a subject.

C#
public virtual System.Security.Claims.Claim Clone();

Returns

The new claim object.

Remarks

This is a shallow copy operation. The Subject property of the new Claim object is set to null.

Applies to

.NET 10 and other versions
Product Versions
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 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, 2.1
UWP 10.0