NovusCore.Shared.Data
2.2.4
See the version list below for details.
dotnet add package NovusCore.Shared.Data --version 2.2.4
NuGet\Install-Package NovusCore.Shared.Data -Version 2.2.4
<PackageReference Include="NovusCore.Shared.Data" Version="2.2.4" />
<PackageVersion Include="NovusCore.Shared.Data" Version="2.2.4" />
<PackageReference Include="NovusCore.Shared.Data" />
paket add NovusCore.Shared.Data --version 2.2.4
#r "nuget: NovusCore.Shared.Data, 2.2.4"
#:package NovusCore.Shared.Data@2.2.4
#addin nuget:?package=NovusCore.Shared.Data&version=2.2.4
#tool nuget:?package=NovusCore.Shared.Data&version=2.2.4
RetireAix Shared Service
A Clean Architecture .NET 8 Web API microservice following CQRS pattern with EF Core and Dapper.
๐๏ธ Architecture
This project follows a pragmatic architecture pattern optimized for 40 microservices sharing a single PostgreSQL database:
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Presentation (WebApi) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ Infrastructure โ Application โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ Shared.Data (NuGet) โ Shared โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Layers
- Shared.Data (NuGet v2.0.0): Entities, repositories, migrations - shared across 40 microservices
- Shared: Common DTOs, models, and utilities
- Application: CQRS implementation with MediatR (Commands/Queries/Handlers)
- Infrastructure: AWS services (S3, Secrets Manager, SQS), Redis, Email
- WebApi: REST API controllers and middleware
๐ Getting Started
Prerequisites
- .NET 8 SDK
- PostgreSQL 16+
- Redis (optional for caching)
- AWS Account (optional for cloud services)
Installation
Clone the repository
git clone https://github.com/your-org/retireaix-shared-service.git cd retireaix-shared-serviceRestore dependencies
dotnet restoreUpdate connection string
Edit
src/RetireAix.SharedService.WebApi/appsettings.json:"ConnectionStrings": { "DefaultConnection": "Host=localhost;Port=5432;Database=sharedservice_db;Username=postgres;Password=yourpassword;" }Create database migration
cd src/RetireAix.Shared.Data dotnet ef migrations add InitialCreate --startup-project ../RetireAix.SharedService.WebApi dotnet ef database update --startup-project ../RetireAix.SharedService.WebApiRun the application
cd src/RetireAix.SharedService.WebApi dotnet runAccess Swagger UI
Navigate to:
https://localhost:5001orhttp://localhost:5000
๐ Project Structure
RetireAix.SharedService/
โโโ src/
โ โโโ RetireAix.Shared.Data/ # NuGet Package: Entities, Repos, Migrations
โ โโโ RetireAix.SharedService.Shared/ # Models, DTOs, Constants
โ โโโ RetireAix.SharedService.Application/ # CQRS, Handlers, Validators
โ โโโ RetireAix.SharedService.Infrastructure/ # AWS, Redis, Email services
โ โโโ RetireAix.SharedService.WebApi/ # Controllers, Middleware, Health Checks
โโโ tests/
โ โโโ RetireAix.SharedService.Tests/
โโโ docs/
โโโ arch.md
โโโ CONFIGURATION_GUIDE.md
โโโ IMPLEMENTATION_GUIDE.md
โโโ PROJECT_STRUCTURE.md
๐ ๏ธ Technology Stack
| Technology | Version | Purpose |
|---|---|---|
| .NET | 8.0 | Framework |
| PostgreSQL | 16+ | Database |
| Entity Framework Core | 8.0.10 | ORM (Write) |
| Dapper | 2.1.35 | Micro-ORM (Read) |
| MediatR | 12.2+ | CQRS Mediator |
| FluentValidation | 11.9+ | Validation |
| AutoMapper | 12.0+ | Object Mapping |
| Serilog | 8.0+ | Logging |
| AWS SDK | 3.7.400+ | Cloud Services |
| Redis | 7+ | Caching |
| MailKit | 4.3+ | |
| Swashbuckle | 6.5+ | API Documentation |
| Polly | 8.0+ | Resilience & Retry |
| Asp.Versioning | 8.1.1 | API Versioning |
| AspNetCore.HealthChecks | 9.0+ | Advanced Health Monitoring |
๐ Database
Commands (Write Operations)
- Uses EF Core with change tracking
- Automatic audit trail (CreatedAt, UpdatedAt, etc.)
- Soft delete support
- Transaction management via Unit of Work
Queries (Read Operations)
- Uses Dapper for high-performance reads
- Raw SQL queries
- No change tracking overhead
- Direct DTO mapping
๐ง Configuration
Environment Variables
# Database
ConnectionStrings__DefaultConnection="Host=localhost;Port=5432;Database=mydb;Username=postgres;Password=pass;"
# AWS
AWS_REGION="us-east-1"
AWS_ACCESS_KEY_ID="your-access-key"
AWS_SECRET_ACCESS_KEY="your-secret-key"
# Redis
Redis__ConnectionString="localhost:6379"
# Email
Email__SmtpHost="smtp.gmail.com"
Email__SmtpPort="587"
Email__Username="your-email@gmail.com"
Email__Password="your-app-password"
๐ฅ Health Checks
The service provides comprehensive health monitoring through multiple endpoints:
Health Check Endpoints
Complete Health Check
GET /health
Returns detailed health status of all dependencies:
{
"status": "Healthy",
"totalDuration": 45.23,
"checks": [
{
"name": "postgresql",
"status": "Healthy",
"description": "No description provided",
"duration": 23.45,
"tags": ["db", "sql", "postgresql", "ready"]
},
{
"name": "redis",
"status": "Healthy",
"description": "No description provided",
"duration": 12.34,
"tags": ["cache", "redis", "ready"]
},
{
"name": "aws-s3",
"status": "Healthy",
"description": "No description provided",
"duration": 9.44,
"tags": ["aws", "s3", "storage", "ready"]
}
],
"timestamp": "2026-01-20T10:30:00Z"
}
Readiness Probe (Kubernetes)
GET /health/ready
Checks if the application is ready to serve traffic. Returns only checks tagged with "ready".
Liveness Probe (Kubernetes)
GET /health/live
Simple check to verify the application is running. Always returns "Healthy" if the app responds.
Health Check Configuration
Health checks are automatically configured for:
- PostgreSQL - Database connectivity (5s timeout)
- Redis - Cache connectivity (3s timeout)
- AWS S3 - Storage service availability (5s timeout)
Configure thresholds in appsettings.json:
"HealthChecks": {
"TimeoutSeconds": {
"PostgreSQL": 5,
"Redis": 3,
"S3": 5
}
}
Kubernetes Integration
Use these probes in your Kubernetes deployment:
livenessProbe:
httpGet:
path: /health/live
port: 80
initialDelaySeconds: 10
periodSeconds: 30
readinessProbe:
httpGet:
path: /health/ready
port: 80
initialDelaySeconds: 5
periodSeconds: 10
๐งช Testing
# Run all tests
dotnet test
# Run tests with coverage
dotnet test /p:CollectCoverage=true
๐ณ Docker
Build Image
docker build -t retireaix-shared-service:latest .
Run with Docker Compose
docker-compose up -d
โจ Production-Ready Features
This service includes enterprise-grade features for production deployments:
Observability & Monitoring
- โ Correlation ID Tracking - Distributed tracing across microservices
- โ Enhanced Logging - Structured logs with Serilog (IP, UserAgent, timing)
- โ
Advanced Health Checks - Multiple endpoints with detailed JSON responses
/health- Complete health check (PostgreSQL, Redis, AWS S3)/health/ready- Readiness probe for Kubernetes/health/live- Liveness probe for container orchestration
- โ Request Logging - Every request logged with enriched context
Resilience & Reliability
- โ Retry Policies - Automatic retry with exponential backoff (Polly)
- โ Circuit Breaker - Prevent cascade failures
- โ EF Core Retry - Database connection resilience (3 retries, 30s delay)
- โ Rate Limiting - IP-based rate limiting (100 req/min)
Performance
- โ Response Compression - Gzip compression for JSON/XML
- โ Response Caching - HTTP-level caching for GET requests
- โ Memory Cache - In-process caching alongside Redis
- โ Async/Await - All I/O operations are asynchronous
Security
- โ HSTS Headers - Force HTTPS in production
- โ Input Validation - FluentValidation on all commands
- โ SQL Injection Prevention - Parameterized queries
- โ Error Information Hiding - Generic errors in production
- โ CORS Configuration - Cross-origin request control
API Features
- โ API Versioning - URL segment + header versioning
- โ Swagger/OpenAPI - Interactive API documentation
- โ Global Exception Handling - Consistent error responses
- โ Result Pattern - Standardized response format
Data Access
- โ CQRS Pattern - Separate read/write models
- โ Dapper snake_case Mapping - Auto-map PostgreSQL columns
- โ Soft Delete - Logical deletion with audit trail
- โ Centralized Configuration - Strongly-typed config with validation
See IMPLEMENTATION_GUIDE.md for detailed documentation.
๐ Documentation
- Implementation Guide - Complete feature documentation
- Configuration Guide - Environment setup and settings
- Architecture Documentation
- Clean Architecture Guide
- API Documentation
๐ค Contributing
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
๐ License
This project is licensed under the MIT License.
๐ฅ Team
- RetireAix Development Team
- Contact: support@retireaix.com
๐ Related Projects
- RetireAix-PlanSponsor
- RetireAix Contact Management
- RetireAix Document Service
Generated with โค๏ธ using Pragmatic Architecture and CQRS patterns
| 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.35)
- Microsoft.EntityFrameworkCore (>= 8.0.24)
- Microsoft.Extensions.Configuration.Binder (>= 10.0.1)
- NovusCore.AuditService.ChangeTracking (>= 1.0.0)
- Npgsql (>= 8.0.8)
- Npgsql.EntityFrameworkCore.PostgreSQL (>= 8.0.11)
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 |
|---|---|---|
| 2.2.12 | 105 | 2/24/2026 |
| 2.2.11 | 86 | 2/23/2026 |
| 2.2.10 | 83 | 2/23/2026 |
| 2.2.9 | 84 | 2/21/2026 |
| 2.2.8 | 84 | 2/21/2026 |
| 2.2.7 | 83 | 2/21/2026 |
| 2.2.5 | 93 | 2/20/2026 |
| 2.2.4 | 99 | 2/17/2026 |
| 2.2.3 | 86 | 2/17/2026 |
| 2.2.2 | 90 | 2/16/2026 |
| 2.2.1 | 95 | 2/16/2026 |
| 2.2.0 | 91 | 2/15/2026 |
| 2.1.0 | 90 | 2/15/2026 |
| 2.0.9 | 90 | 2/14/2026 |
| 2.0.8 | 92 | 2/14/2026 |
| 2.0.7 | 95 | 2/8/2026 |
| 2.0.6 | 88 | 2/7/2026 |
| 2.0.5 | 104 | 2/3/2026 |
| 2.0.4 | 113 | 2/3/2026 |