Skip to content

Latest commit

 

History

History
37 lines (22 loc) · 1.32 KB

README.md

File metadata and controls

37 lines (22 loc) · 1.32 KB

CommunityToolkit.Aspire.Hosting.RavenDB library

Provides extension methods and resource definitions for an Aspire AppHost to configure a RavenDB resource.

Getting started

Install the package

In your AppHost project, install the Aspire RavenDB Hosting library with NuGet:

dotnet add package CommunityToolkit.Aspire.Hosting.RavenDB

Usage example

Then, in the Program.cs file of AppHost, add a RavenDB resource and consume the connection using the following methods:

var db = builder.AddRavenDB("ravendb").AddDatabase("mydb");

var myService = builder.AddProject<Projects.MyService>()
                       .WithReference(db);

Open databases in RavenDB Studio

Every database added with AddDatabase(...) exposes a clickable RavenDB Studio link in the Aspire dashboard that opens that database's Documents view directly (for example http://localhost:9534/studio/index.html#databases/documents?&database=mydb). The link is added automatically — no extra configuration is required. For secured servers it uses the configured public server URL.

Additional documentation

https://learn.microsoft.com/dotnet/aspire/community-toolkit/ravendb

Feedback & contributing

https://github.com/CommunityToolkit/Aspire