neo4j-driver-dotnet-skill
适合在 C#/.NET 项目中集成与调试 Neo4j
提供 Neo4j .NET 驱动 v6 的会话、事务与查询使用指南
讲清在 C#/.NET 中用 Neo4j .NET 驱动 v6 的实务:IDriver 生命周期、DI 注册(单例)、ExecuteReadAsync/ExecuteWriteAsync、IResultCursor 的 Fetch/ToListAsync 以及 .Get<T>/As<T> 的记录访问。适合搭建服务端连接 Neo4j、做异步查询、取消(CancellationToken)与类型映射时参考。要注意的是它聚焦驱动与异步/映射陷阱,不负责 Cypher 查询优化。
▸ 展开 SKILL.md 英文原文
Neo4j .NET Driver v6 — IDriver lifecycle, DI registration (singleton), ExecutableQuery fluent API, ExecuteReadAsync/ExecuteWriteAsync managed transactions, IResultCursor (FetchAsync/ ToListAsync), record value access (.Get<T>/As<T>), null safety, UNWIND batching, temporal types, await using, EagerResult, object mapping, CancellationToken, error handling, and common traps. Use when writing C# or .NET code connecting to Neo4j. Also triggers on Neo4j.Driver, IDriver, ExecutableQuery, ExecuteReadAsync, ExecuteWriteAsync, IResultCursor, IAsyncSession, or any Bolt/Aura work in .NET/C#. Does NOT handle Cypher authoring — use neo4j-cypher-skill. Does NOT cover driver version upgrades — use neo4j-migration-skill.
帮我安装这个 skill:https://raw.githubusercontent.com/neo4j-contrib/neo4j-skills/main/neo4j-driver-dotnet-skill/SKILL.mdcurl -fsSL "https://raw.githubusercontent.com/neo4j-contrib/neo4j-skills/main/neo4j-driver-dotnet-skill/SKILL.md"## When to Use - Writing C# or .NET code connecting to Neo4j - Setting up `IDriver`, DI registration, or session/transaction lifecycle - Questions about `ExecutableQuery`, `IResultCursor`, async patterns, result mapping - Debugging sessions, type mapping, null safety, or error handling in .NET ## When NOT to Use - **Writing/optimizing Cypher queries** → `neo4j-cypher-skill` - **Upgrading from older driver version** → `neo4j-migration-skill` --- ## Install ```bash dotnet add package Neo4j.Driver ``` | Package | Use | |---|---| | `Neo4j.Driver` | Async API — **use this** | | `Neo4j.Driver.Simple` | Synchronous wrapper | | `Neo4j.Driver.Reactive` | System.Reactive streams | --- ## Driver