Muslim.GenericRepository.Interface
8.0.0
dotnet add package Muslim.GenericRepository.Interface --version 8.0.0
NuGet\Install-Package Muslim.GenericRepository.Interface -Version 8.0.0
<PackageReference Include="Muslim.GenericRepository.Interface" Version="8.0.0" />
<PackageVersion Include="Muslim.GenericRepository.Interface" Version="8.0.0" />
<PackageReference Include="Muslim.GenericRepository.Interface" />
paket add Muslim.GenericRepository.Interface --version 8.0.0
#r "nuget: Muslim.GenericRepository.Interface, 8.0.0"
#:package Muslim.GenericRepository.Interface@8.0.0
#addin nuget:?package=Muslim.GenericRepository.Interface&version=8.0.0
#tool nuget:?package=Muslim.GenericRepository.Interface&version=8.0.0
Muslim.GenericRepository.Interface
The abstraction only: IRepository<TEntity> and the fourteen interfaces it composes — reads,
writes, soft delete, bulk operations, counts, raw SQL and save.
Reference this when you want to depend on the contract without the EF Core implementation — a
Domain or Application project that declares IUserRepository : IRepository<User> and lets the Data
project supply the concrete type.
dotnet add package Muslim.GenericRepository.Interface
If you want a working repository, install
Muslim.GenericRepository instead — it
brings this package with it.
Namespaces
IRepository<T> and the interfaces it inherits live apart, so consumers import both:
using Muslim.GenericRepository.Interface; // IRepository<T>
using Muslim.IGenericRepository; // ICreate<T>, IFind<T>, IDelete<T>, …
Shape
IRepository<TEntity> composes, for TEntity : Entity:
| Interface | Covers |
|---|---|
IGetById<T> |
primary-key lookup, entity or projected |
IGetAll<T> |
whole-table reads |
IFind<T> |
predicate and IFilter<T> reads (grid paging, sorting, search) |
IFirstOrDefault<T> |
first match, or null |
ISingleOrDefault<T> |
the one match — throws if more than one |
ICreate<T> |
inserts, entity- or DTO-driven, staged or committed |
IUpdate<T> |
updates, with audit columns preserved from the database |
IDelete<T> |
hard deletes, including bulk DeleteWhereAsync |
ISoftDelete<T> |
soft deletes and restore, including bulk |
IEntityState<T> |
change-tracker access: detach, force state |
ICount<T> / IAny<T> |
counts and existence checks |
ISqlOperations<T> |
raw and interpolated SQL |
ISave<T> |
commit staged changes |
Plus Query and QueryAsNoTracking for anything the named methods do not cover.
Conventions the contract assumes
Create*stages,SaveCreate*commits. The same split applies to update, delete and soft delete. Stage when several repositories must succeed or fail together.- Audit columns are written by the implementation —
CreatedBy/CreatedDateon insert,UpdateBy/UpdateDateon update,IsDeleted/DeletedBy/DeletedDateon soft delete. All timestamps are UTC. isTracking(defaulttrue) on entity-returning reads. Projection overloads omit it: EF never tracks a projection to a non-entity type.- Bulk
*WhereAsync/*ByIdsAsyncmethods run one statement and need noSave(). They do not load entities, so the change tracker andSaveChangesoverrides never see those rows.
Every member ships with XML documentation, so hovering a call in your IDE shows the summary, an example and what it returns.
License
See LICENSE.txt. Free for personal and commercial use under the stated conditions.
| 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 was computed. 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. |
-
net8.0
- Microsoft.EntityFrameworkCore (>= 8.0.31)
- Muslim.EntityAndDto (>= 8.0.0)
- Muslim.Filter (>= 8.0.0)
- Muslim.Inject (>= 8.0.0)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on Muslim.GenericRepository.Interface:
| Package | Downloads |
|---|---|
|
Muslim.GenericRepository
EF Core repository for entities with audit columns: reads, writes, soft delete, bulk operations and raw SQL, with CreatedBy/UpdateBy/DeletedBy and UTC timestamps written automatically. Implements Muslim.GenericRepository.Interface. |
|
|
Muslim.GenericService
Package Description |
GitHub repositories
This package is not used by any popular GitHub repositories.
Bumps the Muslim.Inject dependency to 2.3.0 (adds parameterless Inject<T>()/InjectRequired<T>()/TryInject<T>(out T) overloads and Reset() for test teardown — source-compatible, see its own CHANGELOG). No changes to this package's own members.