PostSharpAPI ReferencePost­Sharp.​ExtensibilityIState­StoreGet­Or­New
Open sandboxFocus

IStateStore.GetOrNew Method

GetOrNew<T>()

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

Declaration
T GetOrNew<T>()
where T : new()
Returns
Type Description
T

Either the value of type T present in the cache, either a new object of type T.

Type Parameters
Name Description
T

Type of value.