Class KevlarProperties

Namespace
Kevlar
Assembly
Kevlar.dll

A strongly typed property bag carried by KevlarContext for passing custom data between the caller, execution delegate, and strategy callbacks. The bag is pooled with its context and must not be retained beyond the current callback or delegate. A completion callback receives this same live bag immediately before it is recycled; copy required values into caller-owned state rather than retaining the bag.

public sealed class KevlarProperties
Inheritance
KevlarProperties
Inherited Members

Properties

Count

Gets the number of values currently stored in the bag.

public int Count { get; }

Property Value

int

Methods

Contains<T>(KevlarKey<T>)

Returns whether a value is stored under the given key.

public bool Contains<T>(KevlarKey<T> key)

Parameters

key KevlarKey<T>

Returns

bool

Type Parameters

T

GetOrDefault<T>(KevlarKey<T>, T)

Reads the value stored under the given key, or returns defaultValue.

public T GetOrDefault<T>(KevlarKey<T> key, T defaultValue = default)

Parameters

key KevlarKey<T>
defaultValue T

Returns

T

Type Parameters

T

Remove<T>(KevlarKey<T>)

Removes the value stored under the given key.

public bool Remove<T>(KevlarKey<T> key)

Parameters

key KevlarKey<T>

Returns

bool

true when a value was removed; otherwise false.

Type Parameters

T

Set<T>(KevlarKey<T>, T)

Stores a value under the given key, replacing any existing value.

public void Set<T>(KevlarKey<T> key, T value)

Parameters

key KevlarKey<T>
value T

Type Parameters

T

TryGet<T>(KevlarKey<T>, out T)

Attempts to read the value stored under the given key.

public bool TryGet<T>(KevlarKey<T> key, out T value)

Parameters

key KevlarKey<T>
value T

Returns

bool

Type Parameters

T