EntityFrameworkCore.ExplicitConfiguration 1.0.0-preview.1

This is a prerelease version of EntityFrameworkCore.ExplicitConfiguration.
There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package EntityFrameworkCore.ExplicitConfiguration --version 1.0.0-preview.1
                    
NuGet\Install-Package EntityFrameworkCore.ExplicitConfiguration -Version 1.0.0-preview.1
                    
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="EntityFrameworkCore.ExplicitConfiguration" Version="1.0.0-preview.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="EntityFrameworkCore.ExplicitConfiguration" Version="1.0.0-preview.1" />
                    
Directory.Packages.props
<PackageReference Include="EntityFrameworkCore.ExplicitConfiguration" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add EntityFrameworkCore.ExplicitConfiguration --version 1.0.0-preview.1
                    
#r "nuget: EntityFrameworkCore.ExplicitConfiguration, 1.0.0-preview.1"
                    
#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.
#:package EntityFrameworkCore.ExplicitConfiguration@1.0.0-preview.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=EntityFrameworkCore.ExplicitConfiguration&version=1.0.0-preview.1&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=EntityFrameworkCore.ExplicitConfiguration&version=1.0.0-preview.1&prerelease
                    
Install as a Cake Tool

EntityFrameworkCore.ExplicitConfiguration

True explicit EF Core configuration behaviour. Nothing is discovered unless you configure it.

Problem

EF Core discovers a lot by convention.

That is convenient until the model contains things you never meant to map:

  • entities discovered through navigation properties
  • properties added just because they exist on the CLR type
  • keys inferred from naming conventions
  • foreign keys, indexes, cascade rules, and value generation configured implicitly

This package switches that default. Only what you configure explicitly ends up in the model.

Installation

dotnet add package EntityFrameworkCore.ExplicitConfiguration

Usage

services.AddDbContext<MyContext>(options =>
    options
        .UseSqlServer(connectionString) // or any other provider
        .UseExplicitConfiguration());

You can re-enable selected convention groups when needed:

services.AddDbContext<MyContext>(options =>
    options
        .UseSqlServer(connectionString) // or any other provider
        .UseExplicitConfiguration(options =>
        {
            options.EnablePropertyDiscovery = true;
            options.EnableKeyDiscovery = true;
        }));

Behavior

By default, the package disables:

  • entity discovery
  • property discovery
  • key discovery
  • foreign key discovery
  • cascade delete convention
  • foreign key index convention
  • value generation convention

That gives you a model where unmapped CLR members are absent unless you configure them explicitly.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  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. 
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
1.0.0-preview.2 57 4/11/2026
1.0.0-preview.1 58 4/11/2026