Cratis Arc Entity Framework Core integration
Cratis Arc’s Entity Framework Core integration lets your application store and query relational data without requiring Chronicle or event sourcing. Add the optional Cratis.Arc.EntityFrameworkCore package when you need relational persistence, then follow getting started to register your contexts and select a provider. Apply your database schema separately; registration does not create it.
Topics
Section titled “Topics”| Topic | Description |
|---|---|
| Getting Started | How to configure Entity Framework Core with Arc, including auto-discovery and observation support. |
| Base DbContext | Apply Arc’s model conventions to your context. |
| Entity Mapping | Keep entity configuration in IEntityTypeConfiguration<T> classes. |
| Read Only DbContexts | How to implement read-only database contexts for query scenarios. |
| Automatic Database hookup | Provider detection, pooled context registration, and connection-string limits. |
| Upserts | Tracked persistence and atomic native upserts for SQL Server, PostgreSQL, and SQLite. |
| Observing DbSet | Refresh query results after changes, with provider-specific notification setup and explicit lifetime ownership. |
| Common Column Types | Common column type configurations and conventions. |
| Property Extensions | Configure value conversion for individual properties. |
| Json | Store marked properties as JSON with provider-specific column types and configurable serialization. |
| Geometry storage paths | Explicit string conversion versus JSON properties and spatial migration declarations. |
| Guid conversion | SQLite string conversion and migration type differences. |
| Concept conversion | Store strongly typed values. |
Overview
Section titled “Overview”Choose a context around the work it performs. Use BaseDbContext for Arc’s model conventions, or combine read-only contexts and registration for query code with no-tracking reads and SaveChanges guards. Database permissions remain the boundary when writes must be prevented.
For complex properties, choose JSON conversion or an explicit geometry storage path before creating migrations: a JSON string converter is not a native spatial mapping. Once ordinary reads work, observe a DbSet if clients need refreshed results. That page explains which writes each provider can detect and how to own the observation’s lifetime.