JM.Core.Persistence
1.0.0-alpha.1
dotnet add package JM.Core.Persistence --version 1.0.0-alpha.1
NuGet\Install-Package JM.Core.Persistence -Version 1.0.0-alpha.1
<PackageReference Include="JM.Core.Persistence" Version="1.0.0-alpha.1" />
<PackageVersion Include="JM.Core.Persistence" Version="1.0.0-alpha.1" />
<PackageReference Include="JM.Core.Persistence" />
paket add JM.Core.Persistence --version 1.0.0-alpha.1
#r "nuget: JM.Core.Persistence, 1.0.0-alpha.1"
#:package JM.Core.Persistence@1.0.0-alpha.1
#addin nuget:?package=JM.Core.Persistence&version=1.0.0-alpha.1&prerelease
#tool nuget:?package=JM.Core.Persistence&version=1.0.0-alpha.1&prerelease
JM Core Packages
Reusable .NET packages for application, persistence, security, exception handling, and logging concerns.
Packages
| Package | Purpose |
|---|---|
JM.Core.Persistence |
Entity base classes, repository abstractions, EF Core repository implementation, pagination, and dynamic query helpers. |
JM.Core.CrossCuttingConcerns |
Exception types, problem details, exception middleware, and Serilog-based logging utilities. |
JM.Core.Security |
Security entities, JWT helpers, hashing utilities, claims extensions, OTP helpers, and security service registration. |
JM.Core.Application |
MediatR pipeline behaviors for validation, authorization, caching, logging, and transactions. |
All packages currently target net10.0.
Installation
Install only the packages your project needs:
dotnet add package JM.Core.Persistence --version 1.0.0
dotnet add package JM.Core.CrossCuttingConcerns --version 1.0.0
dotnet add package JM.Core.Security --version 1.0.0
dotnet add package JM.Core.Application --version 1.0.0
Package dependency order:
JM.Core.Persistence
JM.Core.CrossCuttingConcerns
JM.Core.Security -> JM.Core.Persistence
JM.Core.Application -> JM.Core.CrossCuttingConcerns, JM.Core.Persistence, JM.Core.Security
Security Setup
builder.Services.AddSecurityServices();
Configuration:
{
"TokenOptions": {
"Audience": "example-audience",
"Issuer": "example-issuer",
"AccessTokenExpiration": 60,
"SecurityKey": "use-a-long-secure-key-from-secrets",
"RefreshTokenTTL": 7
}
}
Do not store production signing keys in source-controlled configuration files.
Exception Middleware Setup
app.UseExceptionMiddleware();
Register the middleware before endpoint execution so application exceptions can be converted into problem details responses.
Logging Setup
File logger configuration:
{
"SerilogConfigurations": {
"FileConfiguration": {
"FolderPath": "/logs/app"
}
}
}
SQL logger configuration:
{
"SerilogConfigurations": {
"MsSqlConfiguration": {
"ConnectionString": "Server=.;Database=Logs;Trusted_Connection=True;TrustServerCertificate=True;",
"TableName": "Logs",
"AutoCreateSqlTable": true
}
}
}
Register one logger implementation:
builder.Services.AddSingleton<LoggerServiceBase, FileLogger>();
or:
builder.Services.AddSingleton<LoggerServiceBase, MsSqlLogger>();
Caching Setup
Register an IDistributedCache implementation:
builder.Services.AddDistributedMemoryCache();
Configuration:
{
"CacheSettings": {
"SlidingExpiration": 2
}
}
SlidingExpiration is interpreted as days when a request does not provide a custom expiration.
MediatR Pipeline Setup
Register only the behaviors used by the consuming application:
builder.Services.AddMediatR(configuration =>
{
configuration.RegisterServicesFromAssembly(typeof(Program).Assembly);
});
builder.Services.AddHttpContextAccessor();
builder.Services.AddTransient(typeof(IPipelineBehavior<,>), typeof(RequestValidationBehavior<,>));
builder.Services.AddTransient(typeof(IPipelineBehavior<,>), typeof(AuthorizationBehavior<,>));
builder.Services.AddTransient(typeof(IPipelineBehavior<,>), typeof(CachingBehavior<,>));
builder.Services.AddTransient(typeof(IPipelineBehavior<,>), typeof(CacheRemovingBehavior<,>));
builder.Services.AddTransient(typeof(IPipelineBehavior<,>), typeof(LoggingBehavior<,>));
builder.Services.AddTransient(typeof(IPipelineBehavior<,>), typeof(TransactionScopeBehavior<,>));
Register validators if using validation behavior:
builder.Services.AddValidatorsFromAssembly(typeof(Program).Assembly);
Packaging
The canonical packaging and release process is documented in NUGET_GUIDE.md.
License
This project is licensed under the MIT License.
| 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
- Microsoft.EntityFrameworkCore (>= 10.0.6)
- System.Linq.Dynamic.Core (>= 1.7.2)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on JM.Core.Persistence:
| Package | Downloads |
|---|---|
|
JM.Core.Application
MediatR pipeline behaviors, request and response models, validation, authorization, caching, logging, and transaction markers for .NET applications. |
|
|
JM.Core.Security
Security entities, JWT helpers, hashing utilities, claims extensions, OTP helpers, and security service registration for .NET applications. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.0-alpha.1 | 78 | 4/28/2026 |
See CHANGELOG.md.