Object Graph Mapper for .NET

I know that there is an official Object Graph Mapper for Java. However, I haven't found anything official for .NET so I searched for solutions from the community and I found two:

  1. https://www.blueprint41.com/
  2. GitHub - francnuec/Neo4jClient.DataAnnotations: Use POCO classes in the Neo4jClient library ORM style. Annotate with System.ComponentModel.DataAnnotations.Schema attributes. Supports Complex Types too.

Question 1
Have you worked with blueprint41 or Neo4jClient.DataAnnotations? If so, can you share our opinions and recommendations?

Question 2
Do you know any other mappers for .NET?

1 Like

Hey @michalkomorowski1984

You're right - there is no official OGM, and won't be - personally I've not used either of those, the only thing I could add is that yesterday a new one was released: GitHub - OKTAYKIR/NeoClient: Lightweight OGM for Neo4j which support transactions and BOLT protocol. that might be of interest.

Sorry I can't be more useful!

Chris

I haven’t used either,
Tangentially related that maybe useful I have written a nuget package that manages constraints and indexes via attributes on POCOs (Node, NodeKey, named Indexes).
Its also got a few extensions to ensure the graph is in line with whatever classes you have defined.

I also went the route of writing extensions that convert from Record to whatever POCO. It’s a different approach but I prefer to have full control over the cypher so tend to stay away from mappers.

I can share the nuget package links if you’d like. Repo currently isn’t public but I suppose it could be.

Full disclosure, I made Blueprint41 and I do not have experience with the other ORM's mentioned.

Blueprint41 is stable, and is used in some big enterprise software projects. It is open source (MIT license) and has free support over email. You can use it to do object to graph mapping for read/write operations and you can do Cypher queries (with IntelliSense support) for fast & complex read operations.

It also has support for refactoring you graph model, which automatically upgrades the data in you graph and updates your mapped objects so you get compile time errors for any code that was incompatible with your graph model changes.

At the moment Neo4j 3.x is supported and support for Neo4j 4.x is coming soon.

If you have any questions, just contact me via the blueprint41 website.

1 Like

Note for those coming to this conversation later...

I have been evaluating Blueprint41, and there is so much to love! It handily beats anything else I have looked at.

The one notable limitation is that it doesn't seem to support relationship properties. Because relationship properties are required for many APOC PathFinding algorithms, consider whether that is a requirement for your project.

I have reached out to on their GitHub to see if they have a workaround on the relationship property issue. Will report back here.

Great news for those following this topic...
@Blueprint41 has indicated on their GitHub that they are working on a solve for relationship attributes!

While waiting for this functionality, I have been prototyping using Blueprint41, and it has so far been a positive experience!

Hello everyone,

in case this topic still sounds interesting to any dotnet developers.

we have an OGM released for neo4j dotnet 8 and neo4j which we tried to have it feel pretty close to efcore.

The library is a preview release and new features is in scope.

You can find it here: GitHub - berrybeat/Neo4j.Berries.OGM: This repository adds an OGM functionality for csharp

Looking forward to your feedback.

Cheers,
Farhad