PostSharp 5.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: 5.0.55.0 (5.0.55.0)
Syntax
C#
T GetOrNew<T>()
where T : new()

Type Parameters

T
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