SemanticTypeModel.EFCore 4.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package SemanticTypeModel.EFCore --version 4.0.0
                    
NuGet\Install-Package SemanticTypeModel.EFCore -Version 4.0.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="SemanticTypeModel.EFCore" Version="4.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="SemanticTypeModel.EFCore" Version="4.0.0" />
                    
Directory.Packages.props
<PackageReference Include="SemanticTypeModel.EFCore" />
                    
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 SemanticTypeModel.EFCore --version 4.0.0
                    
#r "nuget: SemanticTypeModel.EFCore, 4.0.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.
#:package SemanticTypeModel.EFCore@4.0.0
                    
#: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=SemanticTypeModel.EFCore&version=4.0.0
                    
Install as a Cake Addin
#tool nuget:?package=SemanticTypeModel.EFCore&version=4.0.0
                    
Install as a Cake Tool

SemanticTypeModel Package Suite

This README is shared by all SemanticTypeModel.* NuGet packages because the packages are designed, versioned, and tested as one tightly coupled suite.

Version alignment

Use the same exact version for every SemanticTypeModel.* package in your application. Mixing SemanticTypeModel package versions is unsupported.

Generator/analyzer packages are part of that rule too. The compile-time semantic manifest requires exact producer/consumer suite-version alignment.

Choose packages by scenario

Scenario Packages
Define semantic annotations SemanticTypeModel.DotNet
Generate the canonical model at compile time SemanticTypeModel.Generators
JSON Schema SemanticTypeModel.JsonSchema
EF Core SemanticTypeModel.EFCore, SemanticTypeModel.EFCore.Generators
System.Text.Json SemanticTypeModel.SystemTextJson
Microsoft.Extensions.Options SemanticTypeModel.Configuration
Power BI local metadata SemanticTypeModel.PowerBI
Runtime DI composition SemanticTypeModel.DependencyInjection

SemanticTypeModel.Configuration.Generators is not part of the current package suite.

SemanticTypeModel.Abstractions and SemanticTypeModel.Core provide shared model/runtime contracts used by the suite. Applications normally start from the scenario packages rather than selecting internal package layers first.

Minimal model

using SemanticTypeModel.DotNet;

[SemanticType(SemanticTypeRole.Entity)]
[SemanticMutable]
public sealed class Customer
{
    [SemanticKey]
    [SemanticImmutable]
    public required string Id { get; init; }

    public required string Name { get; init; }
}

With SemanticTypeModel.Generators, build the project and consume the generated provider:

using SemanticTypeModel.Generated;

TypeSchemaModel model = AppSemanticTypeModel.Create();

Lifecycle mutability is optional. No mutability attribute means STM makes no lifecycle-mutability claim.

Configure

Common generator settings include:

  • generated namespace/provider name;
  • discovery mode and namespace filters;
  • internal type/member inclusion;
  • naming policy;
  • key inference;
  • technical-description requirements;
  • System.Text.Json metadata import.

General relationship inference is not a current generator capability.

See the complete configuration reference.

JSON Schema semantic annotations

SemanticTypeModel.JsonSchema exports Draft 2020-12 and can preserve selected STM-only semantics under one optional x-stm object:

role
aggregateRoot
mutability
technicalDescription
keys
unit
ui

JSON Schema import and JSON Editor compatibility modes are not supported current APIs.

EF Core application

SemanticTypeModel.EFCore.Generators emits composable IEntityTypeConfiguration<TEntity> implementations for explicitly selected semantic models. Applications own DbContext composition and unrelated/manual entities.

The model assembly's semantic manifest is ephemeral compile-time transport. Model and EF generator packages must use the same exact SemanticTypeModel suite version.

Diagnose

If generation or projection fails:

  • Troubleshooting — symptom-oriented fixes;
  • Diagnostics — diagnostic IDs and fixes;
  • target guides below — target-specific limitations and policies.

Target guides

Package roles

Package Responsibility
SemanticTypeModel.Abstractions Shared canonical model/runtime contracts
SemanticTypeModel.Core Core semantics, transformations, diagnostics, inspection
SemanticTypeModel.DotNet Attributes and Roslyn extraction contracts
SemanticTypeModel.Generators Compile-time canonical model provider and semantic manifest generation
SemanticTypeModel.JsonSchema JSON Schema derivation and Draft 2020-12 export
SemanticTypeModel.EFCore EF relational inspection, selection contract, converters/comparers/helpers
SemanticTypeModel.EFCore.Generators Generated composable IEntityTypeConfiguration<TEntity> application
SemanticTypeModel.SystemTextJson Resolver metadata derivation/customization
SemanticTypeModel.Configuration Configuration semantic model and explicit Options registration
SemanticTypeModel.PowerBI Deterministic local analytical metadata projection
SemanticTypeModel.DependencyInjection Runtime provider/projection service registration

Important boundaries

SemanticTypeModel defines semantic meaning and target projection defaults; applications own global target infrastructure composition.

For example:

  • EF Core remains responsible for providers/migrations/database lifecycle; applications own their DbContext, manual EF configuration, and target-specific relationships;
  • System.Text.Json serializer contexts remain application-owned;
  • Power BI service publishing/authentication remains outside local metadata projection;
  • JSON Schema is an export target, not a canonical authoring source.

See Compatibility for current breaking boundaries.

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 (1)

Showing the top 1 NuGet packages that depend on SemanticTypeModel.EFCore:

Package Downloads
SemanticTypeModel.EFCore.Generators

Generates composable EF Core entity configurations from explicitly selected SemanticTypeModel manifests. Install it in an EF persistence project to produce ordinary IEntityTypeConfiguration code; it does not scan or clean unrelated DbContext entities.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
5.0.0 37 8/23/2026
4.0.1 91 8/18/2026
4.0.0 100 8/16/2026
2.6.0 103 8/4/2026
2.5.3 98 8/4/2026
2.5.1 98 8/4/2026
2.5.0 100 8/3/2026
2.4.6 98 8/3/2026
2.4.5 99 8/3/2026
2.4.4 106 8/2/2026
2.4.3 96 7/31/2026
2.4.2 98 7/31/2026
2.4.1 108 7/3/2026
2.4.0 102 7/2/2026
2.3.0 109 6/20/2026
2.2.0 121 6/16/2026
2.1.0 110 6/15/2026
2.0.0 121 6/7/2026
1.1.0 115 6/4/2026
1.0.0 122 6/1/2026
Loading failed