https://github.com/circles-arrows/blueprint41
An Object Graph Mapper for CSharp to connect to Neo4j or Memgraph.
https://github.com/circles-arrows/blueprint41
dotnet graph migrations neo4j ogm orm-library
Last synced: about 1 year ago
JSON representation
An Object Graph Mapper for CSharp to connect to Neo4j or Memgraph.
- Host: GitHub
- URL: https://github.com/circles-arrows/blueprint41
- Owner: circles-arrows
- License: mit
- Created: 2017-09-05T08:13:55.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2025-05-31T11:01:29.000Z (about 1 year ago)
- Last Synced: 2025-05-31T23:17:46.565Z (about 1 year ago)
- Topics: dotnet, graph, migrations, neo4j, ogm, orm-library
- Language: C#
- Homepage: http://www.blueprint41.com/
- Size: 36.7 MB
- Stars: 34
- Watchers: 8
- Forks: 8
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
✔️ Supports for Neo4j and Memgraph
✔️ Works Visual Studio, Visual Studio Code and Rider
✔️ Develop on Windows, macOS or Linux
Blueprint41
### .NET ORM for Neo4j and Memgraph Database
Simplify database operations through generated data access objects.
### Frictionless Development with Intellisense

### Neo4j Plugins (Optional)
* Download Blueprint41 plugin for [Neo4j v5](https://github.com/circles-arrows/functionalid/blob/master/blueprint41-5.0.0.jar?raw=true), [Neo4j v4](https://github.com/circles-arrows/functionalid/blob/master/blueprint41-4.0.3.jar?raw=true) or [Neo4j v3](https://github.com/circles-arrows/functionalid/blob/master/blueprint41-1.0.3.jar?raw=true).
* Download APOC plugin [here](https://neo4j-contrib.github.io/neo4j-apoc-procedures/#_download_latest_release).
To learn more, please visit [Extension and Plugins](https://github.com/circles-arrows/blueprint41/wiki/Extension-and-Plugins).
### Documentation
To learn more, please visit [Blueprint41 wiki](https://github.com/circles-arrows/blueprint41/wiki).
### Connection
```csharp
PersistenceProvider.CurrentPersistenceProvider = new Neo4JPersistenceProvider($"bolt://localhost:7687", $"neo4j", $"password");
```
### Automated Deployment of Schema Upgrades
```csharp
// Datastore defines the latest schema definition
Datastore model = new Datastore();
// Sync database schema with the latest upgrade scripts
model.Execute(true);
```
### Type Safe Creation of Nodes and Relationships
```csharp
using (Transaction.Begin())
{
Movie matrix = new Movie()
{
Title = "The Matrix",
Tagline = "Welcome to the Real World",
Released = new DateTime(1999, 3, 31)
};
Person keanu = new Person()
{
Name = "Keanu Reeves",
Born = new DateTime(1964, 9, 2)
};
Person lana = new Person()
{
Name = "Lana Wachowski",
Born = new DateTime(1961, 7, 30)
};
Person lilly = new Person()
{
Name = "Lilly Wachowski",
Born = new DateTime(1967, 12, 29)
};
// Creates relationship via Type-safe generated objects
movie.Actors.Add(keanu);
movie.Directors.Add(lana);
movie.Directors.Add(lilly);
movie.Genre.Add(Genre.Load(Genre.StaticData.Name.Action));
movie.Genre.Add(Genre.Load(Genre.StaticData.Name.Sci_Fi));
// Commits detected changes to database
Transaction.Commit();
}
```
### Type Safe Querying of the Graph
```csharp
using (Transaction.Begin())
{
// Get Movies of Keanu(Direct relationship)
Person keanu = Person.LoadByName("Keanu Reeves");
EntityCollection movies = keanu.ActedIn; // Movies are retrieve here
// Get Director of Keanu(Spans multiple relationships)
var query = Transaction.CompiledQuery
.Match
(
Node.Person.Alias(out var director)
.In.PERSON_DIRECTED_MOVIE.Out.
Movie
.Out.PERSON_ACTED_IN_MOVIE.In.
Person.Alias(out var actor)
)
.Where(actor.Name == "Keanu Reeves")
.Return(director)
.Compile();
List directors = Person.LoadWhere(query);
}
```