NatsBuilderExtensions.AddNats Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Adds a NATS server resource to the application model. A container is used for local development.
public static Aspire.Hosting.ApplicationModel.IResourceBuilder<Aspire.Hosting.ApplicationModel.NatsServerResource> AddNats (this Aspire.Hosting.IDistributedApplicationBuilder builder, string name, int? port = default);
static member AddNats : Aspire.Hosting.IDistributedApplicationBuilder * string * Nullable<int> -> Aspire.Hosting.ApplicationModel.IResourceBuilder<Aspire.Hosting.ApplicationModel.NatsServerResource>
<Extension()>
Public Function AddNats (builder As IDistributedApplicationBuilder, name As String, Optional port As Nullable(Of Integer) = Nothing) As IResourceBuilder(Of NatsServerResource)
Parameters
- name
- String
The name of the resource. This name will be used as the connection string name when referenced in a dependency.
Returns
The IResourceBuilder<T>.