Kritikos.Configuration.Persistence
2.1.0
dotnet add package Kritikos.Configuration.Persistence --version 2.1.0
NuGet\Install-Package Kritikos.Configuration.Persistence -Version 2.1.0
<PackageReference Include="Kritikos.Configuration.Persistence" Version="2.1.0" />
paket add Kritikos.Configuration.Persistence --version 2.1.0
#r "nuget: Kritikos.Configuration.Persistence, 2.1.0"
// Install Kritikos.Configuration.Persistence as a Cake Addin #addin nuget:?package=Kritikos.Configuration.Persistence&version=2.1.0 // Install Kritikos.Configuration.Persistence as a Cake Tool #tool nuget:?package=Kritikos.Configuration.Persistence&version=2.1.0
Configuration.Persistence
Starting point and useful extensions to handle database persistence via Entity Framework Core.
Persistence Abstractions
IEntity<TKey>
marks and groups primary entities in project having a primary key of typeTKey
IConcurrent
provides RowVersion used by Microsoft SQL Server for database concurrencyITimestamped
andIAuditable<T>
handle audit records and are compatible with provided interceptors
Examples can be found in BasicEntity
, ConcurrentEntity
and Entity
.
Interceptors
A set of pre-transaction interceptors that provide helper functions. Current list includes:
AuditSaveChangesInterceptor
: provides auditing for create/update events, requires an implementation ofIAuditorProvider
in order to workITimeStampSaveChangesInterceptor
: populates fields provided byITimestamped
, auditing create and update dates of each recordReadOnlyDbCommandInterceptor
: turns a database readonly by supressing all actions in SaveChanges
Services
MigrationService<TContext>
is an oneshotHostedService
that enforces database migration before kestrel starts serving requests.
Extensions
Please refrain from using ChangeTracker extensions, they are considered obsolete and will be removed at some point in the future.
EntitiesOfType
is a ModelBuilder extension that allows configuring all entities inheriting common interfaces.
Additional Features
Library Kritikos.Configuration.Peristence.IdentityServer
contains an ApiAuthorizationDbContext wrapper for Microsoft.AspNetCore.ApiAuthorization.IdentityServer
handling the missing overload for IdentityDbContext<TUser,TRole,TKey>
.
KritikosConfiguration.Persistence.HealthCheck
offers a basic DbContext IHealthCheck for use with ASP .NET Core.
Converters
Use with care, not all converters support every available query execution at database level. Consult the documentation before applying.
- DirectoryInfo to string
- FileInfo to string
- Relative URI to string
- TimeSpan to number
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. 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. |
-
net6.0
- Kritikos.Configuration.Persistence.Contracts (>= 2.1.0)
- Microsoft.EntityFrameworkCore.Relational (>= 7.0.11)
- System.ComponentModel.Annotations (>= 5.0.0)
-
net8.0
- Kritikos.Configuration.Persistence.Contracts (>= 2.1.0)
- Microsoft.EntityFrameworkCore.Relational (>= 7.0.11)
- System.ComponentModel.Annotations (>= 5.0.0)
NuGet packages (4)
Showing the top 4 NuGet packages that depend on Kritikos.Configuration.Persistence:
Package | Downloads |
---|---|
Kritikos.Configuration.Peristence.IdentityServer
A simple shim of ApiAuthorizationDbContext, allowing usage of the generic IdentityDbContext<TUser,TRole,TKey> with IdentityServer extension methods on .net 5 |
|
Kritikos.Configuration.Persistence.Interceptors
Interceptors handling common usecase scenarios such us read-only db context, automatic auditing, timestamping |
|
Kritikos.Configuration.Persistence.Converters
ValueConverters for use with EF Core, handle responsibly. |
|
Kritikos.Configuration.Persistence.AspNetCore
Package Description |
GitHub repositories
This package is not used by any popular GitHub repositories.