Kritikos.Configuration.Persistence.Converters 2.1.0

dotnet add package Kritikos.Configuration.Persistence.Converters --version 2.1.0                
NuGet\Install-Package Kritikos.Configuration.Persistence.Converters -Version 2.1.0                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Kritikos.Configuration.Persistence.Converters" Version="2.1.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Kritikos.Configuration.Persistence.Converters --version 2.1.0                
#r "nuget: Kritikos.Configuration.Persistence.Converters, 2.1.0"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Kritikos.Configuration.Persistence.Converters as a Cake Addin
#addin nuget:?package=Kritikos.Configuration.Persistence.Converters&version=2.1.0

// Install Kritikos.Configuration.Persistence.Converters as a Cake Tool
#tool nuget:?package=Kritikos.Configuration.Persistence.Converters&version=2.1.0                

Configuration.Persistence

Build Status codecov Coverage Status Quality Gate Status License GitHub language count GitHub top language

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 type TKey
  • IConcurrent provides RowVersion used by Microsoft SQL Server for database concurrency
  • ITimestamped and IAuditable<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 of IAuditorProvider in order to work
  • ITimeStampSaveChangesInterceptor: populates fields provided by ITimestamped, auditing create and update dates of each record
  • ReadOnlyDbCommandInterceptor: turns a database readonly by supressing all actions in SaveChanges

Services

  • MigrationService<TContext> is an oneshot HostedService 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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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.1.0 151 9/25/2023
2.0.0 345 5/12/2021