What problem does it solve?
It solves the problem of writing correct, production-ready Neo4j connection and query code in C#/.NET, especially when dealing with driver lifecycle, sessions/transactions, result streaming, and type-safe record mapping.
Core Features & Use Cases
- Driver lifecycle and safe disposal: Establishes a single thread-safe IDriver per application and uses await using for correct IAsyncDisposable behavior.
- Managed transactions for correctness and retry safety: Guides when to use ExecuteReadAsync/ExecuteWriteAsync versus explicit transactions, and how to keep managed callbacks idempotent.
- Result consumption and mapping: Explains Cursor handling (FetchAsync, ToListAsync, ConsumeAsync, SingleAsync) and robust record value access with .Get<T>()/.As<T>() including null and absent-key scenarios.
- Practical .NET integration patterns: Covers DI registration as a singleton, cancellation token propagation, UNWIND batching parameterization, and Preview object mapping with AsObject<T>/AsObjectsAsync<T>().
- Error handling and common traps: Provides an exception-handling approach (e.g., ClientException vs Neo4jException) and a checklist of frequent mistakes.
Quick Start
Use this skill to correctly implement Neo4j.Driver v6 in your C# service by registering IDriver as a singleton and running read/write operations with ExecuteReadAsync/ExecuteWriteAsync while consuming results inside the managed transaction callback.