Sdílet prostřednictvím


CustomResourceExtensions.WithInitialState<TResource> Method

Definition

Initializes the resource with the initial snapshot.

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;
static member WithInitialState : Aspire.Hosting.ApplicationModel.IResourceBuilder<'Resource (requires 'Resource :> Aspire.Hosting.ApplicationModel.IResource)> * Aspire.Hosting.ApplicationModel.CustomResourceSnapshot -> Aspire.Hosting.ApplicationModel.IResourceBuilder<'Resource (requires 'Resource :> Aspire.Hosting.ApplicationModel.IResource)> (requires 'Resource :> Aspire.Hosting.ApplicationModel.IResource)
<Extension()>
Public Function WithInitialState(Of TResource As IResource) (builder As IResourceBuilder(Of TResource), initialSnapshot As CustomResourceSnapshot) As IResourceBuilder(Of TResource)

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