AuroraScienceHub.Framework.EntityFramework
10.0.5
Prefix Reserved
dotnet add package AuroraScienceHub.Framework.EntityFramework --version 10.0.5
NuGet\Install-Package AuroraScienceHub.Framework.EntityFramework -Version 10.0.5
<PackageReference Include="AuroraScienceHub.Framework.EntityFramework" Version="10.0.5" />
<PackageVersion Include="AuroraScienceHub.Framework.EntityFramework" Version="10.0.5" />
<PackageReference Include="AuroraScienceHub.Framework.EntityFramework" />
paket add AuroraScienceHub.Framework.EntityFramework --version 10.0.5
#r "nuget: AuroraScienceHub.Framework.EntityFramework, 10.0.5"
#:package AuroraScienceHub.Framework.EntityFramework@10.0.5
#addin nuget:?package=AuroraScienceHub.Framework.EntityFramework&version=10.0.5
#tool nuget:?package=AuroraScienceHub.Framework.EntityFramework&version=10.0.5
AuroraScienceHub.Framework.EntityFramework
Entity Framework Core extensions and utilities for building data access layers with best practices built-in.
Overview
Provides base classes, interceptors, converters, and utilities for Entity Framework Core applications with automatic auditing, soft delete filters, and strong-typed ID support.
Key Features
- Automatic Auditing - Auto-populate CreatedAt/UpdatedAt timestamps
- Soft Delete Filters - Global query filters for soft-deleted entities
- Strong-Typed ID Converters - Value converters for EntityId types
- Migration Helpers - Simplified migration management
- Query Extensions - Enhanced LINQ operations
Installation
dotnet add package AuroraScienceHub.Framework.EntityFramework
Usage
DbContext Setup
public class ApplicationDbContext : DbContext, IDataContext
{
public static string Schema => "app";
public DbSet<User> Users => Set<User>();
public ApplicationDbContext(DbContextOptions<ApplicationDbContext> options)
: base(options)
{
}
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder.HasDefaultSchema(Schema);
modelBuilder.ApplyConfigurationsFromAssembly(GetType().Assembly);
}
}
Automatic Auditing
// Configure with interceptor
builder.Services.AddDbContext<ApplicationDbContext>((sp, options) =>
{
options.UseNpgsql(connectionString)
.AddInterceptors(new AuditingInterceptor());
});
// Entity with auditing
public class User : IEntity<UserId>, IAuditable
{
public UserId Id { get; private set; }
public DateTime CreatedAt { get; set; } // Auto-populated
public DateTime UpdatedAt { get; set; } // Auto-updated
}
Soft Delete
public class Product : IEntity<ProductId>, ISoftDeletable
{
public ProductId Id { get; private set; }
public bool IsDeleted { get; set; }
public DateTime? DeletedAt { get; set; }
}
// Configure filter
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder.Entity<Product>()
.HasQueryFilter(p => !p.IsDeleted);
}
// Deleted products are automatically excluded from queries
var products = await context.Products.ToListAsync();
Strong-Typed IDs
public sealed record UserId(Guid Value) : EntityId<Guid>(Value);
// Configure converter
builder.Property(u => u.Id)
.HasConversion(
id => id.Value,
value => new UserId(value));
Repository Pattern
public class UserRepository
{
private readonly ApplicationDbContext _context;
public async Task<User?> GetByIdAsync(UserId id, CancellationToken ct = default)
{
return await _context.Users.FirstOrDefaultAsync(u => u.Id == id, ct);
}
public async Task AddAsync(User entity, CancellationToken ct = default)
{
await _context.Users.AddAsync(entity, ct);
await _context.SaveChangesAsync(ct);
}
}
License
See LICENSE file in the repository root.
Related Packages
AuroraScienceHub.Framework.Entities- Domain entity interfacesAuroraScienceHub.Framework.EntityFramework.NpgSql- PostgreSQL-specific features
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. 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. |
-
net10.0
- AuroraScienceHub.Framework.Entities (>= 10.0.5)
- AuroraScienceHub.Framework.Json (>= 10.0.5)
- AuroraScienceHub.Framework.ValueObjects (>= 10.0.5)
- Microsoft.EntityFrameworkCore (>= 10.0.7)
- Microsoft.EntityFrameworkCore.Relational (>= 10.0.7)
- Microsoft.Extensions.Caching.Abstractions (>= 10.0.7)
- Microsoft.Extensions.Caching.Memory (>= 10.0.7)
- Microsoft.Extensions.Configuration.Abstractions (>= 10.0.7)
- Microsoft.Extensions.DependencyInjection (>= 10.0.7)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.7)
- Microsoft.Extensions.Hosting.Abstractions (>= 10.0.7)
- Microsoft.Extensions.Logging (>= 10.0.7)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.7)
- Microsoft.Extensions.Options (>= 10.0.7)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on AuroraScienceHub.Framework.EntityFramework:
| Package | Downloads |
|---|---|
|
AuroraScienceHub.Framework.EntityFramework.NpgSql
Entity Framework Core extensions for PostgreSQL with NetTopologySuite spatial support, naming conventions, and database factory patterns. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 10.0.5 | 914 | 4/23/2026 |
| 10.0.4 | 110 | 4/23/2026 |
| 10.0.3 | 432 | 2/11/2026 |
| 10.0.2 | 460 | 1/29/2026 |
| 10.0.1 | 491 | 12/25/2025 |
| 10.0.0 | 443 | 12/11/2025 |
| 9.0.7 | 2,028 | 11/20/2025 |
| 9.0.6 | 202 | 11/15/2025 |
| 9.0.5 | 254 | 11/8/2025 |
| 9.0.4 | 232 | 10/24/2025 |
| 9.0.3 | 222 | 10/15/2025 |
| 9.0.2 | 198 | 10/15/2025 |
| 9.0.1 | 382 | 10/14/2025 |
| 9.0.1-workflow-test-2.17 | 147 | 10/14/2025 |