ResourceExtensions.TryGetAnnotationsOfType<T> Method

Definition

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

public static bool TryGetAnnotationsOfType<T> (this Aspire.Hosting.ApplicationModel.IResource resource, out System.Collections.Generic.IEnumerable<T>? result) where T : Aspire.Hosting.ApplicationModel.IResourceAnnotation;
static member TryGetAnnotationsOfType : Aspire.Hosting.ApplicationModel.IResource * seq -> bool (requires 'T :> Aspire.Hosting.ApplicationModel.IResourceAnnotation)
<Extension()>
Public Function TryGetAnnotationsOfType(Of T As IResourceAnnotation) (resource As IResource, ByRef result As IEnumerable(Of T)) As Boolean

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