Nera.Lib.Database
1.0.0
dotnet add package Nera.Lib.Database --version 1.0.0
NuGet\Install-Package Nera.Lib.Database -Version 1.0.0
<PackageReference Include="Nera.Lib.Database" Version="1.0.0" />
<PackageVersion Include="Nera.Lib.Database" Version="1.0.0" />
<PackageReference Include="Nera.Lib.Database" />
paket add Nera.Lib.Database --version 1.0.0
#r "nuget: Nera.Lib.Database, 1.0.0"
#:package Nera.Lib.Database@1.0.0
#addin nuget:?package=Nera.Lib.Database&version=1.0.0
#tool nuget:?package=Nera.Lib.Database&version=1.0.0
Nera.Lib.Database
A comprehensive database access layer library for Nera applications, built on Entity Framework Core with advanced patterns and features.
Features
✅ Repository Pattern - Generic and type-safe repository implementations
✅ Specification Pattern - Composable and reusable query logic
✅ Complex ThenInclude Support - Multi-level navigation property loading
✅ Advanced Pagination - Efficient pagination with configurable sorting and filtering
✅ Unit of Work - Transaction management and consistency
✅ Domain Events - Event-driven architecture support
✅ Audit Trail - Automatic tracking of entity changes
✅ Soft Delete - Built-in soft deletion support
✅ Multi-tenancy - Tenant isolation and security
Quick Start
1. Installation
dotnet add package Nera.Lib.Database
2. Basic Usage
// Simple entity retrieval
var users = await userRepository.ListAsync(
SpecificationExtensions.CreateSpec<User>()
.NotDeleted()
.Search("john", "Name", "Email")
.OrderByNewest()
.AsNoTracking()
.Build()
);
// Complex queries with includes
var user = await userRepository.FirstOrDefaultAsync(
SpecificationExtensions.CreateSpec<User>()
.ById(userId)
.WithComplexIncludes(includes => includes
.Include("Profile.Avatar")
.Include("Department.Manager.Profile")
.Include("UserRoles.Role.Permissions"))
.AsNoTracking()
.Build()
);
// Pagination
var pagedUsers = await userRepository.GetPagedResultWithSpecificationAsync(
SpecificationExtensions.CreateSpec<User>()
.NotDeleted()
.Search("active", "Name", "Status")
.OrderByNewest()
.Build(),
pageNumber: 1,
pageSize: 20
);
Documentation
- 📚 Complete Specification Guide - Comprehensive documentation
- ⚡ Quick Start Guide - Get started quickly
- 💡 Examples - Real-world usage examples
Key Components
Repository Pattern
BaseRepository<TEntity, TKey>
- Generic repository base classIRepository<TEntity, TKey>
- Repository interface- Built-in CRUD operations with specifications support
Specification Pattern
BaseSpecification<T>
- Base specification classSpecificationExtensions
- Fluent API for building specificationsComplexIncludeSpecification
- Advanced ThenInclude support- Pre-built specifications for common scenarios
Advanced Features
- Complex ThenInclude: Handle multi-level navigation properties
- Smart Pagination: Efficient counting and data retrieval
- Search & Filtering: Configurable text search across multiple fields
- Sorting: Dynamic sorting with field validation
- Performance: Built-in AsNoTracking and query optimization
Architecture
Nera.Lib.Database/
├── Entities/ # Base entity classes
├── Repositories/ # Repository interfaces and implementations
├── Specifications/ # Specification pattern implementation
├── Persistence/ # Entity Framework Core integration
├── UnitOfWork/ # Unit of Work pattern
├── Events/ # Domain events
├── Aggregates/ # Domain aggregates
└── Examples/ # Usage examples
Requirements
- .NET 9.0 or later
- Entity Framework Core 9.0+
- Nera.Lib.Core 1.0.5+
License
MIT License - see LICENSE file for details.
Contributing
Please read our Contributing Guidelines for details on our code of conduct and the process for submitting pull requests.
Support
For support and questions:
- 📧 Email: support@nextera-systems.com
- 📝 Issues: GitHub Issues
- 📖 Documentation: Wiki
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
- MediatR (>= 13.0.0)
- Microsoft.EntityFrameworkCore (>= 9.0.6)
- Nera.Lib.Core (>= 1.0.5)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last Updated |
---|---|---|
1.0.0 | 97 | 8/3/2025 |