GraphBridge.Generators 0.1.0-preview.3

Prefix Reserved
This is a prerelease version of GraphBridge.Generators.
dotnet add package GraphBridge.Generators --version 0.1.0-preview.3
                    
NuGet\Install-Package GraphBridge.Generators -Version 0.1.0-preview.3
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="GraphBridge.Generators" Version="0.1.0-preview.3" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="GraphBridge.Generators" Version="0.1.0-preview.3" />
                    
Directory.Packages.props
<PackageReference Include="GraphBridge.Generators" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add GraphBridge.Generators --version 0.1.0-preview.3
                    
#r "nuget: GraphBridge.Generators, 0.1.0-preview.3"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package GraphBridge.Generators@0.1.0-preview.3
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=GraphBridge.Generators&version=0.1.0-preview.3&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=GraphBridge.Generators&version=0.1.0-preview.3&prerelease
                    
Install as a Cake Tool

GraphBridge

GraphBridge.Generators

NuGet Roslyn incremental generator License: MIT Developer preview

Optional compile-time mapping for GraphBridge, the Entity Framework Core provider for Neo4j. Declare the graph mapping with attributes; the generator writes ordinary EF fluent registration, static identifiers and a storage fingerprint. The finalized EF model stays the runtime authority, and no generator assembly ships with your application.

<PackageReference Include="GraphBridge.Generators" Version="<version on this page>" PrivateAssets="all" />

Declare the model

using GraphBridge.Generated;

[GraphModel(typeof(Person), SchemaPolicy = GraphSchemaPolicy.ExistingConstraints)]
public static partial class PeopleMapping { }

[GraphNode("Person", nameof(Id))]
public sealed class Person
{
    [GraphProperty("id", true, Conversion = GraphConversion.GuidString)]
    public Guid Id { get; set; }

    [GraphProperty("name", false)]
    public string? Name { get; set; }
}

Call PeopleMapping.Apply(modelBuilder) in OnModelCreating. Once the context model has finalized, call PeopleMapping.Verify(context.Model): it compares the whole storage model with PeopleMapping.Fingerprint and fails if registration was skipped or later configuration changed the storage contract.

What you get

Registration Plain EF fluent code for nodes, composite keys up to sixteen properties, and identified relationships with typed source and target
Identifiers Deterministic label, relationship-type and property-name constants, with optional IRIs
Fingerprint A storage fingerprint that Verify checks against the finalized model
Diagnostics Located compile errors with codes and repair steps instead of guessed mappings

Boundaries

  • The generator never loads your assembly, constructs a context, runs OnModelCreating or opens a database.
  • Constraints are provisioned separately; the generator never checks or deploys them.
  • Not covered yet, among others: inheritance, records, generic or nested entities, shadow properties, alternate keys, association edges, native one-to-many references and custom conversions.
  • Targets netstandard2.0; verified with Roslyn 5.9.0 from .NET SDK 10.0.401.

Read the mapping generator guide for every attribute and diagnostic code, and the documentation for GraphBridge itself. Feedback is welcome in GitHub issues. MIT licensed.

There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.1.0-preview.3 45 10/17/2026
0.1.0-preview.2 56 10/16/2026

Developer preview. Release notes and the breaking-change policy: https://github.com/joslat/GraphBridge.EFCore/blob/main/CHANGELOG.md