Freigeben über


ResourceExtensions.TryGetLastAnnotation<T>(IResource, T) Method

Definition

Attempts to get the last annotation of the specified type from the resource.

public static bool TryGetLastAnnotation<T> (this Aspire.Hosting.ApplicationModel.IResource resource, out T? annotation) where T : Aspire.Hosting.ApplicationModel.IResourceAnnotation;
static member TryGetLastAnnotation : Aspire.Hosting.ApplicationModel.IResource * 'T -> bool (requires 'T :> Aspire.Hosting.ApplicationModel.IResourceAnnotation)
<Extension()>
Public Function TryGetLastAnnotation(Of T As IResourceAnnotation) (resource As IResource, ByRef annotation As T) As Boolean

Type Parameters

T

The type of the annotation to get.

Parameters

resource
IResource

The resource to get the annotation from.

annotation
T

When this method returns, contains the last annotation of the specified type from the resource, if found; otherwise, the default value for T.

Returns

true if the last annotation of the specified type was found in the resource; otherwise, false.

Applies to