Skip to content

Repository files navigation

BB84.EntityFrameworkCore

CI CD CodeQL Dependabot

.NET C# Issues Commit License RepoSize Release

🔎 Overview

BB84.EntityFrameworkCore is a .NET 10.0 library collection that provides a reusable repository pattern implementation for Entity Framework Core applications. It ships as five focused NuGet packages that can be adopted incrementally.

📦 Packages

Package Description
BB84.EntityFrameworkCore.Entities.Abstractions Core entity interface definitions — no dependencies
BB84.EntityFrameworkCore.Entities Default implementations of the entity abstractions
BB84.EntityFrameworkCore.Repositories.Abstractions Repository interface definitions
BB84.EntityFrameworkCore.Repositories Repository implementations, provider-agnostic configurations and interceptors
BB84.EntityFrameworkCore.Repositories.SqlServer SQL Server configuration tuning, column type extensions and DatabaseFacadeExtensions

💾 Installation

dotnet add package BB84.EntityFrameworkCore.Entities.Abstractions
dotnet add package BB84.EntityFrameworkCore.Entities
dotnet add package BB84.EntityFrameworkCore.Repositories.Abstractions
dotnet add package BB84.EntityFrameworkCore.Repositories
dotnet add package BB84.EntityFrameworkCore.Repositories.SqlServer

🚧 Build and test

# Build the solution
dotnet build

# Run all tests
dotnet test

The tests are split by what they need. The entity tests and the provider-agnostic repository tests run on SQLite in memory and need nothing installed — together they take a couple of seconds:

dotnet test tests/BB84.EntityFrameworkCore.Entities.Tests
dotnet test tests/BB84.EntityFrameworkCore.Repositories.Agnostic.Tests

Only BB84.EntityFrameworkCore.Repositories.Tests needs Docker. It starts a SQL Server container through Testcontainers and covers what genuinely requires SQL Server: temporal tables, rowversion concurrency, the T-SQL emitting extensions and the provider column types. On Apple silicon that image runs under emulation, which works but is noticeably slower.

The agnostic suite deliberately does not reference the SqlServer package, so a provider-specific call leaking into BB84.EntityFrameworkCore.Repositories is a compile error rather than a surprise on another database.

🏗️ Project structure

BB84.EntityFrameworkCore/
├── src/
│   ├── BB84.EntityFrameworkCore.Entities.Abstractions/   # Entity interface definitions
│   ├── BB84.EntityFrameworkCore.Entities/                # Entity implementations
│   ├── BB84.EntityFrameworkCore.Repositories.Abstractions/ # Repository interface definitions
│   ├── BB84.EntityFrameworkCore.Repositories/            # Repository implementations
│   └── BB84.EntityFrameworkCore.Repositories.SqlServer/  # SQL Server configurations and extensions
├── tests/
│   ├── BB84.EntityFrameworkCore.Entities.Tests/          # Entity unit tests
│   ├── BB84.EntityFrameworkCore.TestSupport.Tests/       # Test model shared by both repository suites
│   ├── BB84.EntityFrameworkCore.Repositories.Agnostic.Tests/ # Provider-agnostic tests (SQLite in memory)
│   └── BB84.EntityFrameworkCore.Repositories.Tests/      # SQL Server tests (requires Docker)
└── docs/                                                 # DocFX documentation source

🤝 Contributing

  1. Fork the repository and create a feature branch from main.
  2. Follow the existing code style (see .editorconfig).
  3. Add XML documentation for all public APIs.
  4. Add unit tests for every new method.
  5. Ensure all tests pass.
  6. Open a pull request describing your changes.

📖 API Documentation

Complete API reference: https://bobobass84.github.io/BB84.EntityFrameworkCore

To build the documentation locally:

dotnet tool install -g docfx
docfx docs/docfx.json --serve

⚖️ License

This project is licensed under the MIT License — see the LICENSE file for details.

About

BB84.EntityFrameworkCore is a .NET 10.0 library collection that provides a reusable repository pattern implementation for Entity Framework Core applications. It ships as five focused NuGet packages that can be adopted incrementally.

Topics

Resources

Code of conduct

Stars

3 stars

Watchers

1 watching

Forks

Releases

Used by

Contributors

Languages