Class ReasonTagExtensions
public static class ReasonTagExtensions
- Inheritance
-
ReasonTagExtensions
- Inherited Members
Methods
Has<T>(IReason, TagKey<T>)
public static bool Has<T>(this IReason reason, TagKey<T> key)
Parameters
Returns
Type Parameters
T
TryGet<T>(IReason, TagKey<T>, out T?)
Tries to get the value of a typed tag from the reason's Tags dictionary.
Returns false if the key is not present or the value cannot be cast to T.
public static bool TryGet<T>(this IReason reason, TagKey<T> key, out T? value)
Parameters
Returns
Type Parameters
T
Examples
if (error.TryGet(DomainTags.Entity, out var entity))
logger.LogError("Entity {Entity} failed", entity);