Developer Guides Getting Started Getting Started What is a Graph Database? Intro to Graph DBs Video Series Concepts: RDBMS to Graph Concepts: NoSQL to Graph Getting Started Resources Neo4j Graph Platform Graph Platform Overview Neo4j Desktop Intro Neo4j Browser Intro… Read more →

Developer Guides

Want to Speak? Get $ back.

Using Neo4j from .NET

Goals
If you are a .NET developer, this guide provides an overview of options for connecting to Neo4j. While this guide is not comprehensive it will introduce the different drivers and link to the relevant resources.
Prerequisites
You should be familiar with graph database concepts and the property graph model. You should have installed Neo4j and made yourself familiar with our Cypher Query language.
Intermediate

Neo4j for .NET Developers

dotnet logo

The .NET platform allows developers to create fascinating applications utilizing graph concepts with Neo4j.

Neo4j aims to have a great experience on Windows with an desktop installer and dedicated PowerShell modules.

With the Neo4j 3.0 release we are happy to provide an officially supported driver for .NET.

Neo4jDotNetDriver

The Neo4j .NET driver is officially supported by Neo4j and connects to the database using the binary protocol. It aims to be minimal, while being idiomatic to .NET.

PM> Install-Package Neo4j.Driver-1.7.0
public class HelloWorldExample : IDisposable
{
    private readonly IDriver _driver;

    public HelloWorldExample(string uri, string user, string password)
    {
        _driver = GraphDatabase.Driver(uri, AuthTokens.Basic(user, password));
    }

    public void PrintGreeting(string message)
    {
        using (var session = _driver.Session())
        {
            var greeting = session.WriteTransaction(tx =>
            {
                var result = tx.Run("CREATE (a:Greeting) " +
                                    "SET a.message = $message " +
                                    "RETURN a.message + ', from node ' + id(a)",
                    new {message});
                return result.Single()[0].As();
            });
            Console.WriteLine(greeting);
        }
    }

    public void Dispose()
    {
        _driver?.Dispose();
    }

    public static void Main()
    {
        using (var greeter = new HelloWorldExample("bolt://localhost:7687", "neo4j", "password"))
        {
            greeter.PrintGreeting("hello, world");
        }
    }
}

Name

Version

Authors

Neo4jDotNetDriver

1.7.0

The Neo4j Team, Chris Skardon, Martin Jensen

Package

Example

Neo4j Online Community

Docs

API

Source

The Example Project

The Neo4j example project is a small, one page webapp for the movies database built into the Neo4j tutorial. The front-end page is the same for all drivers: movie search, movie details, and a graph visualization of actors and movies. Each backend implementation shows you how to connect to Neo4j from each of the different languages and drivers.

You can learn more about our small, consistent example project across many different language drivers here. You will find the implementations for all drivers as individual GitHub repositories, which you can clone and deploy directly.

Neo4j Community Drivers

Members of the each programming language community have invested a lot of time and love to develop each one of the community drivers for Neo4j, so if you use any one of them, please provide feedback to the authors.

The community drivers have been graciously contributed by the Neo4j community. Many of them are fully featured and well-maintained, but some may not be. Neo4j does not take any responsibility for their usability.

Neo4jClient

A .NET client for Neo4j, which makes it easy to write Cypher queries in C# with IntelliSense. It also supports basic CRUD and legacy indexing.

Source

https://github.com/Readify/Neo4jClient

Authors

Chris Skardon Tatham Oddie

Docs

https://github.com/Readify/Neo4jClient/wiki

Example

https://github.com/neo4j-examples/movies-dotnet-neo4jclient

Protocol

Bolt, Http

Cypher.NET

A .NET API for the Neo4j HTTP Transactional Endpoint (v2.0.0) exposes a strongly-typed Graph Query API based on the Neo4j Cypher query language.

Source

https://github.com/mtranter/CypherNet

Authors

Mark Tranter

Blog

http://mtranter.com/2013/09/21/cypher-net-a-neo4j-cypher-api

Protocol

Http