Share via


ProvisioningExtensions.GetSingleResource<T>(IConstruct) Method

Definition

Gets the single resource of type T in the construct or its ancestors.

public static T? GetSingleResource<T> (this Azure.Provisioning.IConstruct construct) where T : Azure.Provisioning.Resource;
static member GetSingleResource : Azure.Provisioning.IConstruct -> 'T (requires 'T :> Azure.Provisioning.Resource)
<Extension()>
Public Function GetSingleResource(Of T As Resource) (construct As IConstruct) As T

Type Parameters

T

The type of Resource to find.

Parameters

construct
IConstruct

The construct.

Returns

T

The Resource if found else null.

Applies to