An example ASP NET MVC Core project to access Neo4j using the official and community drivers.
This is a work in progress and will be updated when it can be.
You need a few things to get the example running:
- Neo4j Server 5.x - easiest way is with Neo4j Desktop, just create a new
5.x
version (any will work) - Movies DataSet - Once you have (1) you need to get the Movies dataset, to do that:
- Start Neo4j
- Open the browser here
- Run
:play movies
- Skip the first page, and play the script on page 2.
Now you're ready!
There are 3 controllers to show the different approaches to coding .NET against a Neo4j Database.
This is the controller using a pure implementation of the Neo4j.Driver with no extensions.
The controller using Neo4j.Driver.Extensions to reduce boiler plate code.
The controller using Neo4jClient - the community driver.
Just some example calls for you to use against the API.
This gets all the Movies in the database
/<controller-specific-api>/list
This gets a specific Movie, provided by the <title>
parameter:
/<controller-specific-api>/title/The%20Matrix
This gets all the actors by Movie (i.e. Title + List of Actors)
/<controller-specific-api>/actors
This gets all the actors by for a specific Movie
/<controller-specific-api>/actors/The%20Matrix