Share via


IDistributedApplicationTestingBuilder.AddResource<T>(T) Method

Definition

Adds a resource of type T to the distributed application.

public Aspire.Hosting.ApplicationModel.IResourceBuilder<T> AddResource<T> (T resource) where T : Aspire.Hosting.ApplicationModel.IResource;
abstract member AddResource : 'T -> Aspire.Hosting.ApplicationModel.IResourceBuilder<'T (requires 'T :> Aspire.Hosting.ApplicationModel.IResource)> (requires 'T :> Aspire.Hosting.ApplicationModel.IResource)
Public Function AddResource(Of T As IResource) (resource As T) As IResourceBuilder(Of T)

Type Parameters

T

The type of resource to add.

Parameters

resource
T

The resource to add.

Returns

A innerBuilder for configuring the added resource.

Exceptions

Thrown when a resource with the same name already exists.

Applies to