MySqlBuilderExtensions.AddDatabase Method

Definition

Adds a MySQL database to the application model.

C#
public static Aspire.Hosting.ApplicationModel.IResourceBuilder<Aspire.Hosting.ApplicationModel.MySqlDatabaseResource> AddDatabase(this Aspire.Hosting.ApplicationModel.IResourceBuilder<Aspire.Hosting.ApplicationModel.MySqlServerResource> builder, string name, string? databaseName = default);

Parameters

builder
IResourceBuilder<MySqlServerResource>

The MySQL server resource builder.

name
String

The name of the resource. This name will be used as the connection string name when referenced in a dependency.

databaseName
String

The name of the database. If not provided, this defaults to the same value as name.

Returns

A reference to the IResourceBuilder<T>.

Applies to

Produit Versions
.NET Aspire 8.0.0, 9.0.0, 9.1.0