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

Definition

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

C#
public static bool TryGetLastAnnotation<T>(this Aspire.Hosting.ApplicationModel.IResource resource, out T? annotation) where T : Aspire.Hosting.ApplicationModel.IResourceAnnotation;

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

Product Versions
.NET Aspire 8.0.0, 9.0.0, 9.1.0