Provides extension methods and resource definitions for .NET Aspire AppHost to configure a Memgraph resource.
In your AppHost Project, install the .NET Aspire Memgraph Hosting library with NuGet:
dotnet add package Aspire.Hosting.Memgraph
Then, in the Program.cs file of AppHost
, add a Memgraph resource and consume the connection using the following methods:
var memegraph = builder
.AddMemgraph("example-name");
var myservice = builder
.AddProject<Projects.MyService>()
.WithReference(memegraph);
An instance of Memgraph Lab, configured with quick connect can also be included with the following method:
var memegraph = builder
.AddMemgraph("example-name")
.WithMemgraphLab();
https://memgraph.com/docs/getting-started/install-memgraph/docker