Neo4jOgm 0.21.8

dotnet add package Neo4jOgm --version 0.21.8
NuGet\Install-Package Neo4jOgm -Version 0.21.8
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="Neo4jOgm" Version="0.21.8" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Neo4jOgm --version 0.21.8
#r "nuget: Neo4jOgm, 0.21.8"
#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 Neo4jOgm as a Cake Addin
#addin nuget:?package=Neo4jOgm&version=0.21.8

// Install Neo4jOgm as a Cake Tool
#tool nuget:?package=Neo4jOgm&version=0.21.8

neo4j-dotnet-ogm

Neo4j Object Graph Mapping Library for .NET

Installation

Quick start

Declare domain entities

[NeoNodeEntity("person", "p")]
public class Person
{
    [NeoNodeId]
    public long? Id { get; set; }
    
    public string Name { get; set; }
    
    [NeoRelationship("ARE_FRIENDS")]
    public List<Person> Friends { get; set; }
    
    [NeoCreatedAt]
    public DateTime? CreatedAt { get; set; }
    
    [NeoUpdatedAt]
    public DateTime? UpdatedAt { get; set; }
    
    [NeoIgnored]
    public string Extra { get; set; }
}

Setup


// make neo4j connection
var authToken = AuthTokens.Basic("neo4j", "12345");
var driver = GraphDatabase.Driver("bolt://localhost:7687", authToken);

// create context by Assembly and load entities
var context = new NeoContext(Assembly.GetExecutingAssembly());

// new repoistory
var repository = new NeoRepository(driver, "neo4j", context);


// Create an entity with relationship
var a = new Person {Name = "A"};
var b = new Person {Name = "B"};
a.Friends = new List<Person> {b};
var created = repository.Create(a);

// Update entity
created.Name = "New name"
repository.Update(created);

// Load entity and relationship by id
var loaded = repository.FindById<Person>(created.Id.Value, new RelationshipOption(){Load = true, Depth = 5});

// Find all entities and relationship with criteria
var crteria = new Criteria("Name", Operator.Equal, "A")
        .Or(new Criteria("Name", Operator.Equal, "B"));
        
var page = repository.FindAll<Person>(new PageRequest(1, 5), crteria, new RelationshipOption {Load = true});

// Delete entity and relationship by id
repository.DeleteById<Person>(created.Id.Value, true);

// Delete all
repository.DeleteAll<Person>();

Product Compatible and additional computed target framework versions.
.NET net5.0 is compatible.  net5.0-windows was computed.  net6.0 was computed.  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 was computed.  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
0.21.8 451 2/25/2021