Aranasoft.Cobweb.EntityFrameworkCore.Validation
1.90.0
Prefix Reserved
dotnet add package Aranasoft.Cobweb.EntityFrameworkCore.Validation --version 1.90.0
NuGet\Install-Package Aranasoft.Cobweb.EntityFrameworkCore.Validation -Version 1.90.0
<PackageReference Include="Aranasoft.Cobweb.EntityFrameworkCore.Validation" Version="1.90.0" />
<PackageVersion Include="Aranasoft.Cobweb.EntityFrameworkCore.Validation" Version="1.90.0" />
<PackageReference Include="Aranasoft.Cobweb.EntityFrameworkCore.Validation" />
paket add Aranasoft.Cobweb.EntityFrameworkCore.Validation --version 1.90.0
#r "nuget: Aranasoft.Cobweb.EntityFrameworkCore.Validation, 1.90.0"
#addin nuget:?package=Aranasoft.Cobweb.EntityFrameworkCore.Validation&version=1.90.0
#tool nuget:?package=Aranasoft.Cobweb.EntityFrameworkCore.Validation&version=1.90.0
Aranasoft.Cobweb.EntityFramework.Validation
Schema validation and testing components for Entity Framework Core.
Cobweb was created by Arana Software, a software agency in Las Vegas, Nevada.
Details
This library provides a set of tools for validating the schema of a DbContext in Entity Framework Core against the connected database. It is useful for ensuring that your EF Core model is in sync with your database schema.
Features
- Validates tables, views, columns, indexes, and foreign keys.
- Allows you to specify which aspects of the schema to validate.
- Provides detailed error messages when validation fails.
Validations
Tables
- Table presence
- Column presence
- Column type
- Column nullability
- Column default values (Entity Framework Core 3.x and later)
Views (Entity Framework Core 3.x and later)
- View presence
- Column presence
- Column type
- Column nullability
Indexes
- Index presence
- Index uniqueness (Entity Framework Core 3.x and later)
Foreign Keys
- Foreign Key presence
Installation
You can install the Aranasoft.Cobweb.EntityFrameworkCore.Validation NuGet package into your project.
dotnet add package Aranasoft.Cobweb.EntityFrameworkCore.Validation
Or via the NuGet Package Manager:
Install-Package Aranasoft.Cobweb.EntityFrameworkCore.Validation
Usage
using Aranasoft.Cobweb.EntityFrameworkCore.Validation
// ...
myApplicationContext.ValidateSchema([options]);
This will validate the schema of the DbContext against the connected database. If there are any discrepancies, a SchemaValidationException will be thrown.
ValidateSchema
requires that the DbContext
uses an Application Service Provider configured with platform-specific design time services.
Example:
var serviceCollection = new ServiceCollection().AddEntityFrameworkDesignTimeServices();
new SqlServerDesignTimeServices().ConfigureDesignTimeServices(serviceCollection);
var serviceProvider = serviceCollection.BuildServiceProvider();
var builder = new DbContextOptionsBuilder<ApplicationDbContext>();
builder.UseSqlServer(myConnection);
builder.UseApplicationServiceProvider(serviceProvider);
var myApplicationContext = new ApplicationDbContext(builder.Options);
Options
using Aranasoft.Cobweb.EntityFrameworkCore.Validation
// ...
var options = new SchemaValidationOptions{
ValidateIndexes = true,
ValidateForeignKeys = true
};
ValidateIndexes
Type: boolean
<br>
Default: true
Set to false
to skip validation of indexes.
ValidateForeignKeys
Type: boolean
<br>
Default: true
Set to false
to skip validation of foreign keys. Useful for platforms that do no use foreign keys.
ValidateNullabilityForTables
Type: boolean
<br>
Default: true
Set to false
to skip validation of nullability on table columns.
ValidateNullabilityForViews
Type: boolean
<br>
Default: false
Set to false
to skip validation of nullability on view columns. By default, many database platforms enable nullability on view columns regardless of nullability on the underlying table column.
This option is not applicable to Entity Framework Core 2.x or Aranasoft.Cobweb.EntityFrameworkCore.Validation 1.2x.x.
License
Cobweb is copyright of Arana Software, released under the BSD License.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. 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. |
-
net9.0
- Microsoft.EntityFrameworkCore.Design (>= 9.0.0 && < 10.0.0)
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.90.0 | 172 | 6/19/2025 |
1.80.0 | 815 | 3/20/2024 |
1.70.0 | 190 | 3/20/2024 |
1.60.2 | 176 | 3/20/2024 |
1.60.1 | 4,541 | 6/20/2022 |
1.60.0 | 1,543 | 1/25/2022 |
1.50.5 | 165 | 3/20/2024 |
1.50.4 | 851 | 6/20/2022 |
1.50.3 | 945 | 1/22/2022 |
1.50.2 | 988 | 1/22/2022 |
1.50.1 | 915 | 1/21/2022 |
1.30.7 | 190 | 3/20/2024 |
1.30.6 | 981 | 6/20/2022 |
1.30.5 | 928 | 1/22/2022 |
1.30.4 | 1,307 | 10/30/2020 |
1.30.3 | 1,033 | 9/16/2020 |
1.30.2 | 1,337 | 4/14/2020 |
1.30.0 | 1,006 | 4/9/2020 |
1.20.7 | 169 | 3/20/2024 |
1.20.6 | 918 | 6/20/2022 |
1.20.5 | 910 | 1/22/2022 |
1.20.4 | 987 | 10/30/2020 |
1.20.2 | 1,007 | 4/14/2020 |
1.20.0 | 1,850 | 12/10/2019 |
1.20.0-preview-10501 | 881 | 12/5/2019 |