Share via


ResourceBuilderExtensions.GetConnectionProperty Method

Definition

Retrieves the value of a specified connection property from the resource's connection properties.

public static Aspire.Hosting.ApplicationModel.ReferenceExpression GetConnectionProperty(this Aspire.Hosting.ApplicationModel.IResourceWithConnectionString resource, string key);
static member GetConnectionProperty : Aspire.Hosting.ApplicationModel.IResourceWithConnectionString * string -> Aspire.Hosting.ApplicationModel.ReferenceExpression
<Extension()>
Public Function GetConnectionProperty (resource As IResourceWithConnectionString, key As String) As ReferenceExpression

Parameters

resource
IResourceWithConnectionString

The resource that provides the connection properties. Cannot be null.

key
String

The key of the connection property to retrieve. Cannot be null.

Returns

The value associated with the specified connection property key.

Remarks

Throws a KeyNotFoundException if the specified key does not exist in the resource's connection properties.

Applies to