Schema validation and testing components for Entity Framework Core.
Cobweb was created by Arana Software, a software agency in Las Vegas, Nevada.
From Package Manager Console:
PM> install-package aranasoft.cobweb.entityframeworkcore.validation
From .NET CLI:
> dotnet add package aranasoft.cobweb.entityframeworkcore.validation
// using Aranasoft.Cobweb.EntityFrameworkCore.Validation
myApplicationContext.ValidateSchema([options]);
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);
// using Aranasoft.Cobweb.EntityFrameworkCore.Validation
var options = new SchemaValidationOptions{
ValidateIndexes = true,
ValidateForeignKeys = true
};
Type: boolean
Default: true
Set to false
to skip validation of indexes.
Type: boolean
Default: true
Set to false
to skip validation of foreign keys. Useful for platforms that do no use foreign keys.
Type: boolean
Default: true
Set to false
to skip validation of nullability on table columns.
Type: boolean
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.
Cobweb is copyright of Arana Software, released under the BSD License.