Skip to content
An Object Graph Mapper for CSharp and Neo4j.
C# HTML
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
Blueprint41.Modeller.Schemas
Blueprint41.Modeller.SetUp
Blueprint41.Modeller.Uninstall
Blueprint41.Modeller
Blueprint41.UnitTest
Blueprint41
Blueprint41Test
Datastore.Generated
Datastore
Dependencies
Documentation
MovieGraph/MovieGraph
OGMSampleCode
packages/CodePlex.LinqToXsd.2.0.2
.gitignore
AdventureWorks.sln
Blueprint41.sln
LICENSE.txt
README.md

README.md

Blueprint41

.NET ORM for Neo4j Graph Database

Simplify database operations through generated data access objects.

Frictionless Development with Intellisense

Intellisense

Required Neo4j Plugins

  • Download Blueprint41 plugin here.
  • Download APOC plugin here.

To learn more, please visit Extension and Plugins.

Documentation

To learn more, please visit Blueprint41 wiki.

Connection

PersistenceProvider.CurrentPersistenceProvider = new Neo4JPersistenceProvider($"bolt://localhost:7687", $"neo4j", $"password");

Automated Deployment of Schema Upgrades

// 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

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

using (Transaction.Begin())
{
    // Get Movies of Keanu(Direct relationship)
    Person keanu = Person.LoadByName("Keanu Reeves");
    EntityCollection<Movie> 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<Person> directors = Person.LoadWhere(query);
}
You can’t perform that action at this time.