From 6af1ef33dd29b3406f607cdd1da99fba6a96745d Mon Sep 17 00:00:00 2001 From: Alireza Baloochi Date: Wed, 28 May 2025 18:05:44 +0330 Subject: [PATCH] Add article for CommunityToolkit.Aspire.Hosting.MySql.Extensions --- .../hosting-mysql-extensions.md | 58 +++++++++++++++++++ docs/community-toolkit/overview.md | 2 + docs/toc.yml | 2 + 3 files changed, 62 insertions(+) create mode 100644 docs/community-toolkit/hosting-mysql-extensions.md diff --git a/docs/community-toolkit/hosting-mysql-extensions.md b/docs/community-toolkit/hosting-mysql-extensions.md new file mode 100644 index 0000000000..6ad7deeef3 --- /dev/null +++ b/docs/community-toolkit/hosting-mysql-extensions.md @@ -0,0 +1,58 @@ +--- +title: MySql hosting extensions +description: Learn how to use the .NET Aspire MySql extensions package which provides extra functionality to the .NET Aspire MySql hosting package. +ms.date: 05/28/2025 +author: Alirexaa +--- + +# .NET Aspire Community Toolkit MySql hosting extensions + +[!INCLUDE [includes-hosting](../includes/includes-hosting.md)] + +[!INCLUDE [banner](includes/banner.md)] + +In this article, you learn about the .NET Aspire Community Toolkit MySql hosting extensions package which provides extra functionality to the .NET Aspire [MySql hosting package](https://nuget.org/packages/Aspire.Hosting.MySql). + +This package provides the following features: + +- [Adminer](https://adminer.org/) management UI +- [DbGate](https://dbgate.org/) management UI + +## Hosting integration + +To get started with the .NET Aspire Community Toolkit MySql hosting extensions, install the [📦 CommunityToolkit.Aspire.Hosting.MySql.Extensions](https://nuget.org/packages/CommunityToolkit.Aspire.Hosting.MySql.Extensions) NuGet package in the AppHost project. + +### [.NET CLI](#tab/dotnet-cli) + +```dotnetcli +dotnet add package CommunityToolkit.Aspire.Hosting.MySql.Extensions +``` + +### [PackageReference](#tab/package-reference) + +```xml + +``` + +--- + +For more information, see [dotnet add package](/dotnet/core/tools/dotnet-add-package) or [Manage package dependencies in .NET applications](/dotnet/core/tools/dependencies). + +## Example usage + +To add the DbGate management UI to your MySql resource, call the `WithDbGate` method on the `MySqlServerResourceBuilder` instance. + +```csharp +var mysql = builder.AddMySql("mysql") + .WithDbGate(); +``` + +To add the Adminer management UI to your MySql resource, call the `WithAdminer` method on the `MySqlServerResourceBuilder` instance. + +```csharp +var mysql = builder.AddMySql("mysql") + .WithAdminer(); +``` + +This will add a new resource to the app host which will be available from the .NET Aspire dashboard. diff --git a/docs/community-toolkit/overview.md b/docs/community-toolkit/overview.md index 74a732391b..b4948b7774 100644 --- a/docs/community-toolkit/overview.md +++ b/docs/community-toolkit/overview.md @@ -89,6 +89,8 @@ To expand the functionality provided by the .NET Aspire integrations, the Commun - [📄 Docs](hosting-redis-extensions.md) - [📦 CommunityToolkit.Aspire.Hosting.MongoDB.Extensions](https://nuget.org/packages/CommunityToolkit.Aspire.Hosting.MongoDB.Extensions) - [📄 Docs](hosting-mongodb-extensions.md) +- [📦 CommunityToolkit.Aspire.Hosting.MySql.Extensions](https://nuget.org/packages/CommunityToolkit.Aspire.Hosting.MySql.Extensions) + - [📄 Docs](hosting-mysql-extensions.md) If you're not seeing an integration or extension you need, you can contribute to the toolkit by creating your own integration and submitting a pull request. For more information, see [How to collaborate](#how-to-collaborate). diff --git a/docs/toc.yml b/docs/toc.yml index 5d8802fc9f..0ba341de82 100644 --- a/docs/toc.yml +++ b/docs/toc.yml @@ -368,6 +368,8 @@ items: href: community-toolkit/hosting-redis-extensions.md - name: PostgreSQL Extensions href: community-toolkit/hosting-postgresql-extensions.md + - name: MySql Extensions + href: community-toolkit/hosting-mysql-extensions.md - name: RavenDB href: community-toolkit/ravendb.md - name: Aspire.Hosting API reference