MongoDB hosting extensions
此内容尚不支持你的语言。
⭐ Community Toolkit
Aspire CLI — 添加 CommunityToolkit.Aspire.Hosting.MongoDB.Extensions 包 Aspire CLI — 输出示例 C# — AppHost.cs XML — 添加 CommunityToolkit.Aspire.Hosting.MongoDB.Extensions 包引用
C# — AppHost.cs
The Aspire Community Toolkit MongoDB hosting extensions package provides extra functionality to the Aspire.Hosting.MongoDB hosting package.
This package provides the following features:
- DbGate management UI
Hosting integration
Section titled “Hosting integration”To get started with the Aspire Community Toolkit MongoDB hosting extensions, install the CommunityToolkit.Aspire.Hosting.MongoDB.Extensions NuGet package in the app host project.
aspire add communitytoolkit-mongodb-extensionsAspire CLI 是交互式的;按提示选择合适的搜索结果:
Select an integration to add:
> communitytoolkit-mongodb-extensions (CommunityToolkit.Aspire.Hosting.MongoDB.Extensions)> Other results listed as selectable options...#:package CommunityToolkit.Aspire.Hosting.MongoDB.Extensions@*<PackageReference Include="CommunityToolkit.Aspire.Hosting.MongoDB.Extensions" Version="*" />Add management UI
Section titled “Add management UI”DbGate management UI
Section titled “DbGate management UI”To add the DbGate management UI to your MongoDB resource, call the WithDbGate method on the MongoDBResourceBuilder instance:
var builder = DistributedApplication.CreateBuilder(args);
var mongodb = builder.AddMongoDB("mongodb") .WithDbGate();
builder.AddProject<Projects.ExampleProject>() .WithReference(mongodb);
// After adding all resources, run the app...This adds a new DbGate resource to the app host which is available from the Aspire dashboard. DbGate is a comprehensive database management tool that provides a web-based interface for managing your MongoDB databases.