Skip to content
Docs Try Aspire

withReference

Function
📦 Aspire.Hosting v13.2.0
interface ContainerResource {
// ... omitted for brevity
withReference(
source: IResource,
connectionName?: string,
optional?: boolean,
name?: string): IResourceWithEnvironment;
}

Signature

method withReference builder
Adds a reference to another resource
withReference(
source: IResource,
connectionName?: string,
optional?: boolean,
name?: string): IResourceWithEnvironment
source IResource
connectionName string optional
optional boolean optional = False
name string optional
IResourceWithEnvironment

Applies to

This function is an extension method on the following types: