NorthernNerds.Aspire.Neo4j is an unofficial Aspire client integration for Neo4j. This package provides the client-side components needed to connect to Neo4j in your Aspire services.
- Register Neo4j client in your service projects
- Automatic injection of configured
IDriver - Integration with Aspire service discovery
- Updated for the .NET Aspire 13.4 release
- Removed the unused
OpenTelemetry.Extensions.Hostingdependency - Thanks to @joshmakestuff for this contribution! (#7)
- Upgraded to .NET 10 and .NET Aspire 13.1
- Added health checks (enabled by default; configurable via
Neo4jClientSettings.DisableHealthChecks) - Improved DI registration to support multiple connections (singleton/keyed singleton)
dotnet add package NorthernNerds.Aspire.Neo4jIn your service project:
using NorthernNerds.Aspire.Neo4j;
var builder = WebApplication.CreateBuilder(args);
builder.AddNeo4jClient("graph-db");Use the injected IDriver in your services:
using Neo4j.Driver;
public class MyService
{
private readonly IDriver _driver;
public MyService(IDriver driver)
{
_driver = driver;
}
public async Task DoSomething()
{
var session = _driver.AsyncSession();
await session.RunAsync("MATCH (n) RETURN n");
}
}Northern Nerds is a one-man freelance software company dedicated to creating high-quality software solutions. For more integrations and tools, follow our work!