Neo4jClient.Memgraph 5.0.3

dotnet add package Neo4jClient.Memgraph --version 5.0.3
                    
NuGet\Install-Package Neo4jClient.Memgraph -Version 5.0.3
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Neo4jClient.Memgraph" Version="5.0.3" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Neo4jClient.Memgraph" Version="5.0.3" />
                    
Directory.Packages.props
<PackageReference Include="Neo4jClient.Memgraph" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Neo4jClient.Memgraph --version 5.0.3
                    
#r "nuget: Neo4jClient.Memgraph, 5.0.3"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Neo4jClient.Memgraph@5.0.3
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Neo4jClient.Memgraph&version=5.0.3
                    
Install as a Cake Addin
#tool nuget:?package=Neo4jClient.Memgraph&version=5.0.3
                    
Install as a Cake Tool

Neo4jClient (Fork — Neo4j + Memgraph)


A .NET client for Neo4j and Memgraph. Supports Cypher queries via fluent interfaces.

This is a fork of the original Neo4jClient with the following changes:

  • Memgraph support — temporal types and Bolt protocol compatibility for Memgraph
  • Newtonsoft.Json → System.Text.Json — replaced all JSON serialization with System.Text.Json

Grab the latest drop straight from the Neo4jClient package on NuGet.


Key Changes in This Fork

Memgraph Support

Memgraph uses the Bolt protocol and is largely compatible with the Neo4j Cypher API. This fork ensures correct handling of Memgraph-specific temporal type formats.

.NET Type → Bolt Type Mapping

All date/time parameters are automatically converted to native Bolt temporal types, which is required by both Neo4j and Memgraph:

.NET type Bolt type Memgraph / Neo4j display
DateTimeOffset ZonedDateTime ZonedDateTime('2025-10-30T18:47:18+00:00[Etc/UTC]')
DateTime LocalDateTime LocalDateTime('2025-10-30T18:47:18')
DateOnly (NET6+) LocalDate Date('2025-10-30')

Example — no special handling needed, just assign your .NET types:

await _client.GraphClient.Cypher
    .Create($"(g:{Neo4jNode.Movie})")
    .Set("g = $data")
    .WithParam("data", new { CreatedOn = DateTimeOffset.UtcNow, ReleaseDate = DateOnly.Today })
    .ExecuteWithoutResultsAsync();

System.Text.Json Migration

Newtonsoft.Json has been fully replaced with System.Text.Json. Custom converters must now implement System.Text.Json.Serialization.JsonConverter<T> instead of Newtonsoft.Json.JsonConverter.

Registering custom converters:

var client = new BoltGraphClient("bolt://localhost:7687", "neo4j", "password");
client.JsonConverters.Add(new MyCustomConverter());
await client.ConnectAsync();

Ignoring properties:

Both [JsonIgnore] (from System.Text.Json) and [Neo4jIgnore] are supported:

public class Movie
{
    public string Title { get; set; }
    [JsonIgnore]
    public string InternalNote { get; set; }
    [Neo4jIgnore]
    public string AnotherIgnoredProp { get; set; }
}

Custom property names:

public class Movie
{
    [JsonPropertyName("title")]
    public string Title { get; set; }
}

Passing native driver date types directly — use [Neo4jDateTime] to bypass automatic conversion:

public class Movie
{
    [Neo4jDateTime]
    public ZonedDateTime CreatedOn { get; set; }
}

Connecting

BoltGraphClient (Neo4j / Memgraph)

// Neo4j
var client = new BoltGraphClient("neo4j://localhost:7687", "neo4j", "password");
await client.ConnectAsync();

// Memgraph
var client = new BoltGraphClient("bolt://localhost:7687", "memgraph", "password");
await client.ConnectAsync();

Breaking Changes vs Original Neo4jClient

  • Newtonsoft.Json is no longer a dependency — replace any Newtonsoft.Json converters or attributes
  • All endpoints are async only — use ExecuteWithoutResultsAsync(), ResultsAsync, etc.
  • Date/time parameters are now sent as native Bolt types — no longer serialized as ISO strings; this is required for correct storage in both Neo4j and Memgraph

Original Package

You can find package: Neo4jClient.Memgraph The upstream project this is forked from: DotNet4Neo4j/Neo4jClient


License Information

Licensed under MS-PL. See LICENSE in the root of this repository for full license text.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
5.0.3 440 7/3/2026
5.0.2 194 6/30/2026
5.0.1 772 5/17/2026
5.0.0 113 5/5/2026