IStateStore.GetOrAdd<T> Method |
Gets a value from the cache or adds it if it does not exist yet.
Namespace: PostSharp.Extensibility
Assembly: PostSharp (in PostSharp.dll) Version: 2023.0.3.0 (2023.0.3.0)
C#
T GetOrAdd<T>( Func<T> getter )
Parameters
- getter
- Type: System.Func<T>
The delegate invoked if no value of type T is present in the cache.
Type Parameters
- T
- Type of the value.
Return Value
Type: TEither the value of type T present in the cache, either the result of the getter delegate.