TCIS.Persistence.EntityFrameworkCore
1.0.0-rc.10
dotnet add package TCIS.Persistence.EntityFrameworkCore --version 1.0.0-rc.10
NuGet\Install-Package TCIS.Persistence.EntityFrameworkCore -Version 1.0.0-rc.10
<PackageReference Include="TCIS.Persistence.EntityFrameworkCore" Version="1.0.0-rc.10" />
<PackageVersion Include="TCIS.Persistence.EntityFrameworkCore" Version="1.0.0-rc.10" />
<PackageReference Include="TCIS.Persistence.EntityFrameworkCore" />
paket add TCIS.Persistence.EntityFrameworkCore --version 1.0.0-rc.10
#r "nuget: TCIS.Persistence.EntityFrameworkCore, 1.0.0-rc.10"
#:package TCIS.Persistence.EntityFrameworkCore@1.0.0-rc.10
#addin nuget:?package=TCIS.Persistence.EntityFrameworkCore&version=1.0.0-rc.10&prerelease
#tool nuget:?package=TCIS.Persistence.EntityFrameworkCore&version=1.0.0-rc.10&prerelease
TCIS.Persistence.EntityFrameworkCore
The library providing the intermediate core layer (Persistence Core) for databases using Entity Framework Core. The library encapsulates enterprise-grade standard Design Patterns such as GenericRepository, UnitOfWork (UoW), and common configurations for TCIS applications.
📦 Installation
dotnet add package TCIS.Persistence.EntityFrameworkCore
⚙️ Configuration (appsettings.json)
The library requires the ConfigurationStore section to be configured with connection strings:
{
"ConfigurationStore": {
"ConnectionString": "Server=myServerAddress;Database=myDataBase;User Id=myUsername;Password=myPassword;",
"ReadConnectionString": "Server=myReadReplica;Database=myDataBase;User Id=myUsername;Password=myPassword;" // Used for read-only tasks (optional)
}
}
🚀 Registration / Setup (Program.cs)
Use the AddTCorePersistence extension method to automatically register DbContext, GenericRepository, EfUnitOfWork, and DapperContext.
using Microsoft.EntityFrameworkCore;
using System.Data.SqlClient;
var builder = WebApplication.CreateBuilder(args);
// Register the entire Persistence Layer Core
builder.Services.AddTCorePersistence<MyApplicationDbContext>(
configuration: builder.Configuration,
dbConnectionCreator: connectionString => new SqlConnection(connectionString),
dbOptionsAction: (sp, options) => {
options.UseSqlServer("name=ConnectionStrings:DefaultConnection");
});
💡 Usage
Once registered, you can inject IGenericRepository<TEntity> and IUnitOfWork into your Services.
using TCIS.Core.Abstractions.Repositories;
public class OrderService
{
private readonly IGenericRepository<Order> _orderRepo;
private readonly IUnitOfWork _unitOfWork;
public OrderService(IGenericRepository<Order> orderRepo, IUnitOfWork unitOfWork)
{
_orderRepo = orderRepo;
_unitOfWork = unitOfWork;
}
public async Task CreateOrderAsync(Order order)
{
await _orderRepo.AddAsync(order);
// Save changes to the DB via EfUnitOfWork
await _unitOfWork.SaveChangesAsync();
}
}
Benefits:
- Unit Of Work (
EfUnitOfWork): Safely manages Transactions, ensuring data consistency. - Generic Repository: Provides basic CRUD operations out-of-the-box without needing to rewrite code for each Entity.
- Built-in Dapper Integration:
AddTCorePersistencewill also registerIDapperContext, allowing for raw SQL queries to optimize performance.
| 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
- Dapper (>= 2.1.66)
- Microsoft.EntityFrameworkCore (>= 8.0.13)
- Microsoft.EntityFrameworkCore.Relational (>= 8.0.13)
- Microsoft.Extensions.Caching.Abstractions (>= 8.0.0)
- Microsoft.Extensions.Caching.Memory (>= 8.0.1)
- Microsoft.Extensions.Configuration.Abstractions (>= 9.0.0)
- Microsoft.Extensions.Configuration.Binder (>= 9.0.0)
- Microsoft.Extensions.DependencyInjection (>= 9.0.0)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 9.0.0)
- Microsoft.Extensions.Logging (>= 9.0.0)
- Microsoft.Extensions.Logging.Abstractions (>= 9.0.0)
- Microsoft.Extensions.Options (>= 9.0.0)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 9.0.0)
- Microsoft.Extensions.Options.DataAnnotations (>= 8.0.0)
- TCIS.Observability.Classification (>= 1.0.0-rc.10)
- TCIS.Persistence.Abstractions (>= 1.0.0-rc.10)
- TCIS.Persistence.Dapper (>= 1.0.0-rc.10)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on TCIS.Persistence.EntityFrameworkCore:
| Package | Downloads |
|---|---|
|
TCIS.Pluggable.Persistence.EntityFrameworkCore
TCIS Core Framework is an application framework for building modular, multi-tenant applications on ASP.NET Core. Pluggable Persistence EntityFrameworkCore |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.0-rc.10 | 39 | 7/24/2026 |
| 1.0.0-rc.9 | 56 | 7/21/2026 |
| 1.0.0-rc.8 | 53 | 7/21/2026 |
| 1.0.0-rc.7 | 55 | 7/17/2026 |