ResourceExtensions.TryGetAnnotationsOfType<T> Method

Definition

Attempts to retrieve all annotations of the specified type from the given resource.

C#
public static bool TryGetAnnotationsOfType<T>(this Aspire.Hosting.ApplicationModel.IResource resource, out System.Collections.Generic.IEnumerable<T>? result) where T : Aspire.Hosting.ApplicationModel.IResourceAnnotation;

Type Parameters

T

The type of annotation to retrieve.

Parameters

resource
IResource

The resource to retrieve annotations from.

result
IEnumerable<T>

When this method returns, contains the annotations of the specified type, if found; otherwise, null.

Returns

true if annotations of the specified type were found; otherwise, false.

Applies to

Product Versions
.NET Aspire 8.0.0, 9.0.0, 9.1.0