MagicCSharp.Data.EntityFramework 1.0.0

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

MagicCSharp.Data.EntityFramework

Entity Framework Core implementation of the repository contracts in MagicCSharp.Data. Provider-agnostic; add MagicCSharp.Data.Postgres for PostgreSQL wiring.

The three types per entity

Type Role
Order What the application passes around. Immutable record.
OrderEdit The writable fields. Order derives from it, so an entity is accepted wherever an edit is.
OrderDal The row. EF attributes, and the mapping in ToEntity() / Apply().

The split is what keeps EF attributes and column names out of business logic, and what makes "these fields can be written" a compile-time fact rather than a convention.

Base classes

Pick by key shape, then by what the entity needs:

Id (Snowflake) Key (string)
CRUD BaseIdRepository BaseKeyRepository
+ pagination BaseIdPaginatedRepository BaseKeyPaginatedRepository
+ soft delete BaseIdSoftDeleteRepository BaseKeySoftDeleteRepository
+ search BaseIdSearchRepository BaseKeySearchRepository

A derived repository supplies CreateDal and ApplyFilter; everything else is inherited.

What the base classes handle

Batch writes that fail as a unit rather than half-applying. Re-reading after create and update so navigation properties are populated rather than silently empty. Stamping Updated only when something actually changed, so a no-op write does not look like an edit. A context per operation from the factory, so a repository is safe to hold as a singleton.

MagicDbContext

Derive your context from it for two conventions: enums stored as their names, so inserting a member in the middle of an enum does not change the meaning of rows already written; and DateTimeOffset normalized to UTC before it is written, so a value does not come back with a different offset than it went in with.

Product 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. 
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 MagicCSharp.Data.EntityFramework:

Package Downloads
MagicCSharp.Data.Postgres

PostgreSQL wiring for MagicCSharp.Data.EntityFramework: a pooled context factory with sane pool and retry settings that fails fast on a bad connection string, a design-time factory for dotnet ef, and a command interceptor that normalizes DateTimeOffset parameters to UTC so timestamptz predicates bind on any machine.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.2 224 9/24/2026
1.0.1 117 9/24/2026
1.0.0 115 9/23/2026