-
-
Notifications
You must be signed in to change notification settings - Fork 83
Add claude.md with project conventions and build instructions #93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,51 @@ | ||||||||||
| # EntityFramework.Exceptions | ||||||||||
|
|
||||||||||
| Typed exception handling for Entity Framework Core. Converts database-specific errors into strongly-typed .NET exceptions instead of generic `DbUpdateException`. | ||||||||||
|
|
||||||||||
| ## Build & Test | ||||||||||
|
|
||||||||||
| ```bash | ||||||||||
| dotnet restore # Restore NuGet dependencies | ||||||||||
| dotnet build --no-restore # Build all projects | ||||||||||
| dotnet test --no-restore # Run tests (requires Docker for Testcontainers) | ||||||||||
| ``` | ||||||||||
|
|
||||||||||
| Tests use **Testcontainers** and require a running Docker daemon for containerized providers (SQL Server, PostgreSQL, MySQL, Oracle), each of which spins up its own container. **SQLite** tests run in-process and do not require Docker. | ||||||||||
|
|
||||||||||
| ## Project Structure | ||||||||||
|
|
||||||||||
| The solution (`EntityFramework.Exceptions.slnx`) has two main layers: | ||||||||||
|
|
||||||||||
| - **DbExceptionClassifier/** — Database-specific error code classification. Each provider implements `IDbExceptionClassifier` to map native error codes to a `DatabaseError` enum. | ||||||||||
| - `Common/` — `IDbExceptionClassifier` interface | ||||||||||
| - `SqlServer/`, `PostgreSQL/`, `MySQL/`, `MySQL.Pomelo/`, `Oracle/`, `Sqlite/` — Provider implementations | ||||||||||
|
|
||||||||||
| - **EntityFramework.Exceptions/** — EF Core integration via interceptors. Catches `DbException`, classifies it, and throws a typed exception. | ||||||||||
| - `Common/` — Base `ExceptionProcessorInterceptor<T>`, exception classes (`UniqueConstraintException`, `CannotInsertNullException`, `MaxLengthExceededException`, `NumericOverflowException`, `ReferenceConstraintException`), `ExceptionFactory` | ||||||||||
| - `SqlServer/`, `PostgreSQL/`, `MySQL/`, `MySQL.Pomelo/`, `Oracle/`, `Sqlite/` — Provider-specific interceptors and `UseExceptionProcessor()` extension methods | ||||||||||
| - `Tests/` — xUnit test suite using Testcontainers | ||||||||||
|
|
||||||||||
| - **Directory.Build.props** — Shared build properties (target framework, version, NuGet metadata). All non-Common projects automatically reference their corresponding Common project. | ||||||||||
|
|
||||||||||
| ## Architecture | ||||||||||
|
|
||||||||||
| 1. **Interceptor pattern**: `ExceptionProcessorInterceptor<TProviderException>` implements `IDbCommandInterceptor` and `ISaveChangesInterceptor` | ||||||||||
| 2. **Classification**: Each database provider has an `IDbExceptionClassifier` that maps native error codes to `DatabaseError` enum values | ||||||||||
| 3. **Factory**: `ExceptionFactory` creates the appropriate typed exception | ||||||||||
| 4. **Extension methods**: Each provider exposes `UseExceptionProcessor()` on `DbContextOptionsBuilder` | ||||||||||
|
|
||||||||||
| ## Code Conventions | ||||||||||
|
|
||||||||||
| - **C# / .NET 8.0** with file-scoped namespaces, primary constructors, nullable reference types, and implicit usings | ||||||||||
|
||||||||||
| - **C# / .NET 8.0** with file-scoped namespaces, primary constructors, nullable reference types, and implicit usings | |
| - **C# / .NET 8.0** with file-scoped namespaces, primary constructors, nullable reference types; implicit usings are enabled in library projects, while test projects use explicit `using` directives |
Copilot
AI
Feb 12, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The statement mentions "nullable reference types" as a code convention, but none of the csproj files examined (Directory.Build.props, Tests.csproj, PostgreSQL.csproj) contain a Nullable property set to "enable". In .NET 8.0, nullable reference types must be explicitly enabled via the Nullable property in the project file. Consider removing "nullable reference types" from this list or clarifying which projects have this enabled, if any.
| - **C# / .NET 8.0** with file-scoped namespaces, primary constructors, nullable reference types, and implicit usings | |
| - **C# / .NET 8.0** with file-scoped namespaces, primary constructors, and implicit usings |
Uh oh!
There was an error while loading. Please reload this page.