PostSharp SDK 2023.0 / / Class Reference / Post­Sharp.​Sdk.​Code­Model Namespace / Declaration­Cache Class / Declaration­Cache Methods / Declaration­Cache.​Get­Item(T) Method

DeclarationCache.GetItem<T> Method

Gets a declaration served by a provider.

Namespace:  PostSharp.Sdk.CodeModel
Assembly:  PostSharp.Compiler.Engine (in PostSharp.Compiler.Engine.dll) Version: 2023.0.3.0 (2023.0.3.0)
Syntax
C#
public T GetItem<T>(
	Func<T> getter
)

Parameters

getter
Type: System.Func<T>
Method providing the cached item

Type Parameters

T

[Missing <typeparam name="T"/> documentation for "M:PostSharp.Sdk.CodeModel.DeclarationCache.GetItem``1(System.Func{``0})"]

Return Value

Type: T
The cached item.
Remarks
The getter parameter is used both as the item key (identification of the requested item) and in order to get the value in case it is not yet in cache. The item cache is not strictly the passed delegate, but only its method, i.e. the object instance is ignored.
See Also