Neo4j.Berries.OGM 1.1.0

There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package Neo4j.Berries.OGM --version 1.1.0
NuGet\Install-Package Neo4j.Berries.OGM -Version 1.1.0
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="Neo4j.Berries.OGM" Version="1.1.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Neo4j.Berries.OGM --version 1.1.0
#r "nuget: Neo4j.Berries.OGM, 1.1.0"
#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.
// Install Neo4j.Berries.OGM as a Cake Addin
#addin nuget:?package=Neo4j.Berries.OGM&version=1.1.0

// Install Neo4j.Berries.OGM as a Cake Tool
#tool nuget:?package=Neo4j.Berries.OGM&version=1.1.0

Neo4j berries OGM

This repository is home to berrybeat's dotnet OGM (Object-Graph-Mapping) library for neo4j. It supports basic queries, create, update, connect/disconnect relations.

Installation

This library is available in nuget and can be installed with the following command:

dotnet add package Neo4j.Berries.OGM

Note: This is a dotnet 8 specific library.

Basic Usage

The following snippet demonstrates the idea of how this library will be used with dependency injection.

public class MoviesController(ApplicationGraphContext graphContext): ControllerBase 
{
    [HttpPost]
    public async Task Create(Movie request) 
    {
        graphContext.Movies.Add(request);
        await graphContext.SaveChangesAsync();
    }
    [HttpPost]
    public async Task Update(Movie request) 
    {
        await graphContext.Movies
            .Match(x => x.Where(y => y.Id, request.Id))
            .UpdateAsync(x => x.Set(request)) //Sets the whole object
    }
}

The queries as you see are not supported with LINQ and instead you need to use the designed Eloquent. Also to use the library you need to add the following to your appsettings.json.

{
    "Neo4j": {
        "Url": "<neo4j-address>",
        "Username": "<neo4j-user>",
        "Password": "<neo4j-password>",
        "Database": "<neo4j-database-name>"
    }
}
  • Neo4j.Url: This is the url to neo4j. For example: http://localhost:7687
  • Neo4j.Username: The username for your database
  • Neo4j.Password: The password for your database
  • Neo4j.Database: This is optional. If not passed, it will connect to the default database. If passed, it will connect to the passed database.
Product Compatible and additional computed target framework versions.
.NET 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. 
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
1.2.0-preview-5 42 4/26/2024
1.2.0-preview-4 44 4/26/2024
1.2.0-preview-3 36 4/25/2024
1.2.0-preview-2 38 4/25/2024
1.1.0 134 4/8/2024
1.1.0-preview3 58 4/5/2024
1.1.0-preview2 66 4/4/2024
1.1.0-preview1 88 4/3/2024
1.0.0 114 4/1/2024
1.0.0-preview-3 73 3/28/2024
1.0.0-preview-2 123 3/26/2024