Skip to content

Latest commit

 

History

History
62 lines (49 loc) · 1.95 KB

File metadata and controls

62 lines (49 loc) · 1.95 KB

NorthernNerds.Aspire.Neo4j

Build Status NuGet Version License

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.

Features

  • Register Neo4j client in your service projects
  • Automatic injection of configured IDriver
  • Integration with Aspire service discovery

Release notes

3.1.0 (since v3.0.0)

  • Updated for the .NET Aspire 13.4 release
  • Removed the unused OpenTelemetry.Extensions.Hosting dependency
  • Thanks to @joshmakestuff for this contribution! (#7)

3.0.0 (since v2.0.0)

  • 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)

Getting Started

Installation

dotnet add package NorthernNerds.Aspire.Neo4j

Usage

In 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");
    }
}

About Northern Nerds

Northern Nerds is a one-man freelance software company dedicated to creating high-quality software solutions. For more integrations and tools, follow our work!