PostSharp 2023.0 / / Post­Sharp Documentation / API Reference / Post­Sharp.​Extensibility Namespace / IState­Store Interface / IState­Store Methods / IState­Store.​Get­Or­New(T) Method

IStateStore.GetOrNew<T> Method

Gets a value from the cache or adds a default value if it does not exist yet.

Namespace:  PostSharp.Extensibility
Assembly:  PostSharp (in PostSharp.dll) Version: 2023.0.3.0 (2023.0.3.0)
T GetOrNew<T>()
where T : new()

Type Parameters

Type of value.

Return Value

Type: T
Either the value of type T present in the cache, either a new object of type T.
See Also