Acontplus.Persistence.Postgres
1.1.0
dotnet add package Acontplus.Persistence.Postgres --version 1.1.0
NuGet\Install-Package Acontplus.Persistence.Postgres -Version 1.1.0
<PackageReference Include="Acontplus.Persistence.Postgres" Version="1.1.0" />
<PackageVersion Include="Acontplus.Persistence.Postgres" Version="1.1.0" />
<PackageReference Include="Acontplus.Persistence.Postgres" />
paket add Acontplus.Persistence.Postgres --version 1.1.0
#r "nuget: Acontplus.Persistence.Postgres, 1.1.0"
#:package Acontplus.Persistence.Postgres@1.1.0
#addin nuget:?package=Acontplus.Persistence.Postgres&version=1.1.0
#tool nuget:?package=Acontplus.Persistence.Postgres&version=1.1.0
Acontplus.Persistence.Postgres
A modern .NET 9+ library for PostgreSQL persistence, ADO.NET, and Entity Framework Core integration. Includes repositories, context management, and advanced error handling for robust data access with PostgreSQL.
🚀 Features
- Database context management - Base context and factory for EF Core
- Repository pattern - Generic and ADO.NET repositories
- PostgreSQL integration - Optimized for PostgreSQL
- Data reader mapping utilities - Fast mapping from DbDataReader
- Parameter handling helpers - Safe and flexible parameterization
- Advanced error handling - Custom exceptions and translators
📦 Installation
NuGet Package Manager
Install-Package Acontplus.Persistence.Postgres
.NET CLI
dotnet add package Acontplus.Persistence.Postgres
PackageReference
<ItemGroup>
<PackageReference Include="Acontplus.Persistence.Postgres" Version="1.0.0" />
</ItemGroup>
🎯 Quick Start
1. Register DbContext and Repository
services.AddDbContext<BaseContext>(options =>
options.UseNpgsql(Configuration.GetConnectionString("DefaultConnection")));
services.AddScoped(typeof(IRepository<,>), typeof(BaseRepository<,>));
2. Use ADO.NET Repository
var repo = serviceProvider.GetRequiredService<IAdoRepository>();
var result = await repo.ExecuteQueryAsync("SELECT * FROM MyTable");
🔧 Advanced Usage
Custom Exception Handling
try {
// ... data access code ...
} catch (RepositoryException ex) {
// handle repository errors
}
DataTable Mapping
var entities = DbDataReaderMapper.MapToList<MyEntity>(reader);
📚 API Documentation
BaseContext
- EF Core base contextDbContextFactory
- Context factoryBaseRepository
/AdoRepository
- Repository implementationsRepositoryException
,SqlDomainException
,UnitOfWorkException
- Error handlingDbDataReaderMapper
- Data reader mappingDataTableNameMapper
- Table name helpers
🤝 Contributing
We welcome contributions! Please see our Contributing Guidelines for details.
Development Setup
git clone https://github.com/Acontplus-S-A-S/acontplus-dotnet-libs.git
cd acontplus-dotnet-libs
dotnet restore
dotnet build
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
🆘 Support
- 📧 Email: proyectos@acontplus.com
- 🐛 Issues: GitHub Issues
- 📖 Documentation: Wiki
👨💻 Author
Ivan Paz - @iferpaz7
🏢 Company
Acontplus S.A.S. - Enterprise software solutions
Built with ❤️ for the .NET community
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net9.0 is compatible. 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. |
-
net9.0
- Acontplus.Core (>= 1.3.2)
- Acontplus.Persistence.Common (>= 1.0.1)
- Microsoft.EntityFrameworkCore (>= 9.0.7)
- Microsoft.Extensions.Configuration.Abstractions (>= 9.0.7)
- Microsoft.Extensions.DependencyInjection (>= 9.0.7)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 9.0.7)
- Microsoft.Extensions.Logging.Abstractions (>= 9.0.7)
- Npgsql (>= 9.0.3)
- Npgsql.EntityFrameworkCore.PostgreSQL (>= 9.0.4)
- Polly (>= 8.6.2)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Initial release for PostgreSQL. Updated for .NET 9+ with async/await, repository pattern, and enhanced documentation.