BB84.EntityFrameworkCore.Repositories.Abstractions
4.5.725
See the version list below for details.
dotnet add package BB84.EntityFrameworkCore.Repositories.Abstractions --version 4.5.725
NuGet\Install-Package BB84.EntityFrameworkCore.Repositories.Abstractions -Version 4.5.725
<PackageReference Include="BB84.EntityFrameworkCore.Repositories.Abstractions" Version="4.5.725" />
<PackageVersion Include="BB84.EntityFrameworkCore.Repositories.Abstractions" Version="4.5.725" />
<PackageReference Include="BB84.EntityFrameworkCore.Repositories.Abstractions" />
paket add BB84.EntityFrameworkCore.Repositories.Abstractions --version 4.5.725
#r "nuget: BB84.EntityFrameworkCore.Repositories.Abstractions, 4.5.725"
#:package BB84.EntityFrameworkCore.Repositories.Abstractions@4.5.725
#addin nuget:?package=BB84.EntityFrameworkCore.Repositories.Abstractions&version=4.5.725
#tool nuget:?package=BB84.EntityFrameworkCore.Repositories.Abstractions&version=4.5.725
BB84.EntityFrameworkCore.Repositories.Abstractions
This package provides the repository interface definitions and the IDbContext abstraction.
Installation
dotnet add package BB84.EntityFrameworkCore.Repositories.Abstractions
IDbContext
A thin abstraction over DbContext that exposes only what repositories need: Set<TEntity>(), SaveChanges, SaveChangesAsync, ChangeTracker, Database, and the save-events. Your application DbContext should implement this interface so repositories remain decoupled from the concrete EF context type.
public class AppDbContext : DbContext, IDbContext
{
public AppDbContext(DbContextOptions<AppDbContext> options) : base(options) { }
// DbSet properties ...
}
// DI registration
services.AddDbContext<AppDbContext>(...);
services.AddScoped<IDbContext>(sp => sp.GetRequiredService<AppDbContext>());
IGenericRepository<TEntity>
The base repository interface. All methods have synchronous and asynchronous variants.
Create
Create(entity)/Create(entities)— marks entity/entities asAddedCreateAsync(entity)/CreateAsync(entities)
Read
GetAll(ignoreQueryFilters, trackChanges)— returns all entitiesGetAll<TResult>(selector, fieldSelector, ignoreQueryFilters)— returns projected DTO listGetByCondition(expression, queryFilter, ignoreQueryFilters, trackChanges, includeProperties)— returns single or nullGetByCondition<TResult>(expression, selector, fieldSelector, ...)— projected singleGetManyByCondition(expression, queryFilter, ignoreQueryFilters, orderBy, skip, take, trackChanges, includeProperties)— paged/filtered listGetManyByCondition<TResult>(...)— projected paged/filtered listCountAll(ignoreQueryFilters)/CountByCondition(expression, ...)— count queries
Stream (asynchronous only, returns IAsyncEnumerable<T>)
StreamAll(ignoreQueryFilters, trackChanges, token)— streams all entitiesStreamAll<TResult>(selector, fieldSelector, ignoreQueryFilters, token)— streams projected DTOsStreamByCondition(expression, queryFilter, ignoreQueryFilters, orderBy, skip, take, trackChanges, token, includeProperties)StreamByCondition<TResult>(...)— streams projected results
The parameters mirror the corresponding GetAllAsync / GetManyByConditionAsync methods; only the return type differs. Unlike those, the result set is not buffered — entities are yielded as they are read from the database. The returned sequence is lazy, so it must be enumerated within the lifetime of the IDbContext and only one stream may be live per context at a time.
Update
Update(entity)/Update(entities)— marks entity/entities asModifiedUpdate(expression, setPropertyCalls)— bulkExecuteUpdate(bypasses change tracker)
Delete
Delete(entity)/Delete(entities)— marks entity/entities asDeletedDelete(expression)— bulkExecuteDelete(bypasses change tracker)
All Async variants accept an optional CancellationToken.
IIdentityRepository<TEntity, TKey> / IIdentityRepository<TEntity>
Extends IGenericRepository<TEntity> with ID-based operations. The non-generic overload defaults TKey to Guid.
Additional read methods
GetById(id, ignoreQueryFilters, trackChanges, includeProperties)GetById<TResult>(id, selector, fieldSelector, ignoreQueryFilters)— projectedGetByIds(ids, ...)/GetByIdsAsync(ids, ...)
Additional delete methods
Delete(id)/Delete(ids)— bulkExecuteDeleteby key(s)
Additional update methods
Update(id, setPropertyCalls)/Update(ids, setPropertyCalls)— bulkExecuteUpdateby key(s)
IEnumeratorRepository<TEntity, TKey> / IEnumeratorRepository<TEntity>
Extends IIdentityRepository with name-based lookups. The non-generic overload defaults TKey to int.
GetByName(name, ignoreQueryFilters, trackChanges)GetByNames(names, ignoreQueryFilters, trackChanges)- Async variants of both
Usage
Define custom repository interfaces against these abstractions:
public interface IProductRepository : IIdentityRepository<Product>
{
Task<IReadOnlyList<Product>> GetByCategoryAsync(int categoryId, CancellationToken token = default);
}
public interface ICategoryRepository : IEnumeratorRepository<ProductCategory>
{
// GetByName / GetByNames already provided
}
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- BB84.EntityFrameworkCore.Entities.Abstractions (>= 4.5.725)
- Microsoft.EntityFrameworkCore.Relational (>= 10.0.10)
-
net8.0
- BB84.EntityFrameworkCore.Entities.Abstractions (>= 4.5.725)
- Microsoft.EntityFrameworkCore.Relational (>= 9.0.18 && < 10.0.0)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on BB84.EntityFrameworkCore.Repositories.Abstractions:
| Package | Downloads |
|---|---|
|
BB84.EntityFrameworkCore.Repositories
This package contains frequently used repository implementations of their respective abstractions, along with provider agnostic entity type configurations and save changes interceptors. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 5.0.1027 | 39 | 10/27/2026 |
| 5.0.1020 | 133 | 10/20/2026 |
| 5.0.916 | 408 | 9/16/2026 |
| 5.0.818 | 303 | 8/18/2026 |
| 4.5.725 | 223 | 7/25/2026 |
| 4.4.724 | 163 | 7/24/2026 |
| 4.4.625 | 252 | 6/25/2026 |
| 4.3.520 | 346 | 5/20/2026 |
| 4.3.513 | 209 | 5/13/2026 |
| 4.3.507 | 175 | 5/7/2026 |
| 4.3.419 | 266 | 4/19/2026 |
| 4.3.327 | 299 | 3/27/2026 |
| 4.2.322 | 199 | 3/22/2026 |
| 4.1.319 | 160 | 3/19/2026 |
| 4.1.222 | 244 | 2/22/2026 |
| 4.1.122 | 241 | 1/22/2026 |
| 4.0.1026 | 441 | 10/26/2025 |
| 4.0.916 | 510 | 9/16/2025 |
| 4.0.817 | 334 | 8/17/2025 |
| 3.1.617 | 436 | 6/17/2025 |