CustomResourceExtensions.WithInitialState<TResource> Method

Definition

Initializes the resource with the initial snapshot.

C#
public static Aspire.Hosting.ApplicationModel.IResourceBuilder<TResource> WithInitialState<TResource>(this Aspire.Hosting.ApplicationModel.IResourceBuilder<TResource> builder, Aspire.Hosting.ApplicationModel.CustomResourceSnapshot initialSnapshot) where TResource : Aspire.Hosting.ApplicationModel.IResource;

Type Parameters

TResource

The resource.

Parameters

builder
IResourceBuilder<TResource>

The resource builder.

initialSnapshot
CustomResourceSnapshot

The factory to create the initial CustomResourceSnapshot for this resource.

Returns

IResourceBuilder<TResource>

The resource builder.

Applies to

Product Versions
.NET Aspire 8.0.0, 9.0.0, 9.1.0