Class IHasPiggyBackExtensions
[InternalApi_DoNotUse_MayChangeWithoutNotice]
public static class IHasPiggyBackExtensions
- Inheritance
-
objectIHasPiggyBackExtensions
Methods
PiggyBackGetExpiring<TData>(IHasPiggyBack, ITimestamped, string, Func<TData>)
Get a value from the Piggyback or create it. Will expire if the parent is updated.
public static (TData Value, bool IsCached) PiggyBackGetExpiring<TData>(this IHasPiggyBack parent, ITimestamped expiring, string key, Func<TData> create)
Parameters
parentIHasPiggyBackexpiringITimestampedParent object with timestamp.
keystringKey to use in the caching dictionary, should be unique for the expected use case.
createFunc<TData>Generator function
Returns
Type Parameters
TData
Remarks
Use this to piggy-back data which may need to expire if the parent changes. If the parent is timestamped
PiggyBackGetExpiring<TPiggyBack, TData>(TPiggyBack, Func<TData>, string?, string?)
Get PiggyBack property using automatic name. Will auto-expire if the app has any changes on it. Uses the caller object name and method for the key.
public static (TData Value, bool IsCached) PiggyBackGetExpiring<TPiggyBack, TData>(this TPiggyBack parent, Func<TData> create, string? cPath = null, string? cName = null) where TPiggyBack : IHasPiggyBack, ITimestamped
Parameters
parentTPiggyBackParent with Piggy-Back and timestamp information
createFunc<TData>cPathstringauto
cNamestringauto
Returns
Type Parameters
TPiggyBackTData
PiggyBackGetExpiring<TPiggyBack, TData>(TPiggyBack, string, Func<TData>)
Get from piggyback, while using the parent as the cache/expiring parameter to ensure reload when app changes
public static (TData Value, bool IsCached) PiggyBackGetExpiring<TPiggyBack, TData>(this TPiggyBack parent, string key, Func<TData> create) where TPiggyBack : IHasPiggyBack, ITimestamped
Parameters
Returns
Type Parameters
TPiggyBackTData
PiggyBackGet<TData>(IHasPiggyBack, string, Func<TData>)
⚠️ This is an internal API and can change at any time.
It's documented so you see how it works.
⚠️ Do not use it, or anything with
⚠️ Do not use it, or anything with
Sys or Internal namespaces in your code, as future changes could break your code.
Get a piggybacked value from the parent, or create it if it doesn't exist.
[InternalApi_DoNotUse_MayChangeWithoutNotice]
public static TData PiggyBackGet<TData>(this IHasPiggyBack parent, string key, Func<TData> create)
Parameters
parentIHasPiggyBackkeystringcreateFunc<TData>
Returns
- TData
Type Parameters
TData
PiggyBackRemove(IHasPiggyBack, string)
Remove a piggybacked value from the parent.
public static void PiggyBackRemove(this IHasPiggyBack parent, string key)
Parameters
parentIHasPiggyBackkeystring