Tolitech.Infrastructure.Persistence.DbConstraintValidator.SqlServer
1.0.0-alpha01
dotnet add package Tolitech.Infrastructure.Persistence.DbConstraintValidator.SqlServer --version 1.0.0-alpha01
NuGet\Install-Package Tolitech.Infrastructure.Persistence.DbConstraintValidator.SqlServer -Version 1.0.0-alpha01
<PackageReference Include="Tolitech.Infrastructure.Persistence.DbConstraintValidator.SqlServer" Version="1.0.0-alpha01" />
paket add Tolitech.Infrastructure.Persistence.DbConstraintValidator.SqlServer --version 1.0.0-alpha01
#r "nuget: Tolitech.Infrastructure.Persistence.DbConstraintValidator.SqlServer, 1.0.0-alpha01"
// Install Tolitech.Infrastructure.Persistence.DbConstraintValidator.SqlServer as a Cake Addin #addin nuget:?package=Tolitech.Infrastructure.Persistence.DbConstraintValidator.SqlServer&version=1.0.0-alpha01&prerelease // Install Tolitech.Infrastructure.Persistence.DbConstraintValidator.SqlServer as a Cake Tool #tool nuget:?package=Tolitech.Infrastructure.Persistence.DbConstraintValidator.SqlServer&version=1.0.0-alpha01&prerelease
Tolitech.Infrastructure.Persistence.DbConstraintValidator
The Tolitech.Infrastructure.Persistence.DbConstraintValidator library offers a streamlined approach to managing and validating database constraint violations within Entity Framework Core applications. This library is designed to enhance error handling by allowing developers to define custom constraint validators that can effectively identify and respond to exceptions arising from database operations.
Features
Static Methods for Error Handling: Provides a static class, DbConstraintValidatorManager, which centralizes the handling of database constraint exceptions.
Customizable Validators: Developers can implement the IConstraintValidator interface to create custom validators tailored to specific database constraints. This enables flexibility in error handling according to the application's needs.
Efficient Exception Management: The library scans registered validators to determine if an exception is caused by a database constraint violation, returning a custom exception when necessary. If no violation is detected, the original exception is returned, maintaining the integrity of the error reporting.
Usage
Add Validators: Use the AddValidator method of DbConstraintValidatorManager to register your custom validators.
Handle Exceptions: Call the Handle method to process exceptions thrown by Entity Framework Core, allowing your application to gracefully handle constraint violations.
Installation
You can install this library via NuGet:
Install-Package Tolitech.Infrastructure.Persistence.DbConstraintValidator
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. |
-
net8.0
- Microsoft.Data.SqlClient (>= 5.2.2)
- Tolitech.Infrastructure.Persistence.DbConstraintValidator (>= 1.0.0-alpha01)
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 |
---|---|---|
1.0.0-alpha01 | 57 | 9/30/2024 |