Share via


RateLimitLease.TryGetMetadata Method

Definition

Overloads

TryGetMetadata(String, Object)

Attempt to extract metadata for the lease.

TryGetMetadata<T>(MetadataName<T>, T)

Attempt to extract a strongly-typed metadata for the lease.

TryGetMetadata(String, Object)

Source:
RateLimitLease.cs

Attempt to extract metadata for the lease.

public abstract bool TryGetMetadata (string metadataName, out object? metadata);
abstract member TryGetMetadata : string * obj -> bool
Public MustOverride Function TryGetMetadata (metadataName As String, ByRef metadata As Object) As Boolean

Parameters

metadataName
String

The name of the metadata. Some common ones can be found in MetadataName.

metadata
Object

The metadata object if it exists.

Returns

True if the metadata exists, otherwise false.

Applies to

TryGetMetadata<T>(MetadataName<T>, T)

Source:
RateLimitLease.cs

Attempt to extract a strongly-typed metadata for the lease.

public bool TryGetMetadata<T> (System.Threading.RateLimiting.MetadataName<T> metadataName, out T metadata);
member this.TryGetMetadata : System.Threading.RateLimiting.MetadataName<'T> * 'T -> bool
Public Function TryGetMetadata(Of T) (metadataName As MetadataName(Of T), ByRef metadata As T) As Boolean

Type Parameters

T

Type of the expected metadata.

Parameters

metadataName
MetadataName<T>

The name of the strongly-typed metadata. Some common ones can be found in MetadataName.

metadata
T

The strongly-typed metadata object if it exists.

Returns

True if the metadata exists, otherwise false.

Applies to