Skip to content
Open
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
eee1169
FullStack takes any column's name: one named like a member it generat…
ejsmith Nov 26, 2026
36d79b1
LookupEnums and Csla warn whoever generates with CodeTemplate.Warning…
ejsmith Nov 26, 2026
98d0217
Legacy README: PLINQO's entity files can use today's C# and VB (=> me…
ejsmith Nov 26, 2026
199e687
Csla: a schema snapshot's web app is wired for the database it was ta…
ejsmith Nov 26, 2026
f23d4f8
Merge branch 'fix/codefileparser-modern-csharp' into fix/pending-2026…
ejsmith Nov 26, 2026
fbf6967
ModernEntities' EF Core templates (and FullStack's and Csla's copies)…
ejsmith Nov 26, 2026
887a5f8
ModernEntities' EF Core templates (and FullStack's and Csla's copies)…
ejsmith Nov 26, 2026
32a58d3
PLINQO's Entities.cst keeps each member of an entity's Metadata class…
ejsmith Nov 26, 2026
76427d9
PLINQO's Dbml.cst fills in the dbml's default values (Mode="Connectio…
ejsmith Nov 26, 2026
812e7a5
PLINQO-EF-DbContext's sample Petshop.csp no longer sets IgnoreList an…
ejsmith Nov 26, 2026
05a94c2
PLINQO: README.md describes the templates and the Metadata class (wha…
ejsmith Nov 26, 2026
f780a4f
FullStack's and Csla's labels come from one routine, NameWords.Label,…
ejsmith Nov 26, 2026
e0f9850
TableToClass's Records.cst and ModernEntities' (and FullStack's) Enti…
ejsmith Nov 26, 2026
08e58ce
FullStack takes a real schema: PostgreSQL arrays are lists, bit strin…
ejsmith Nov 26, 2026
97ee589
Csla takes a real database's schema: arrays are read-only lists CSLA'…
ejsmith Nov 26, 2026
3fc805e
DBDocumenter's title and server are the database's name and the serve…
ejsmith Nov 26, 2026
98c0379
ModernEntities' README says what the configurations map for each data…
ejsmith Nov 26, 2026
a184fc0
Merge branch 'fix/d4-csla' into fix/pending-2026-11-25
ejsmith Nov 26, 2026
34e7b5b
Merge branch 'fix/d4-fullstack' into fix/pending-2026-11-25
ejsmith Nov 26, 2026
bff214e
Merge branch 'fix/d4-plinqo' into fix/pending-2026-11-25
ejsmith Nov 26, 2026
0009ba3
FullStack README: a nullable column with a database default gets it o…
ejsmith Nov 27, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
ModernEntities' README says what the configurations map for each data…
…base (PostgreSQL's timestamp, bit and enums, timestamptz as UTC, MySQL's DATE and TIME, defaults and their sentinels), how a self-reference is named, and Exclude
  • Loading branch information
ejsmith committed Nov 26, 2026
commit 98c0379a9927046c23f97186815341910a3209e3
19 changes: 17 additions & 2 deletions Templates/Database/ModernEntities/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,27 @@ Core's, for its provider for that database (`UseSqlServer`, `UseNpgsql`, `UseMyS
- A column with no .NET type (SQL Server's `geography`, `geometry`, `hierarchyid` or `sql_variant`, PostgreSQL's `point`
or a range) has no property, but a comment where it would be: EF Core can't map an `object`, and the whole model
would fail (its scaffolding leaves such columns out too). Map one in a partial class of your own (with
`Microsoft.SqlServer.Types` or NetTopologySuite, say). A PostgreSQL enum is a `string`: it reads, but Npgsql sends a
string as `text`, so writing one needs the enum mapped (Npgsql's `MapEnum`) in a partial class.
`Microsoft.SqlServer.Types` or NetTopologySuite, say).
- Each entity's configuration (an `IEntityTypeConfiguration<T>`) maps it to its table (with its schema, unless it's
the database's default), its key (composite keys too, in the table's column order; `HasNoKey` without one), its relationships
(`HasPrincipalKey` for one to a unique key that isn't the primary key), a key the application numbers
(`ValueGeneratedNever`), a rowversion and a `jsonb` column. The context applies them all.
- What a database's EF Core provider can't take as it is, the configuration maps, as EF Core's scaffolding does:
- PostgreSQL: `timestamp` (Npgsql's `DateTime` is `timestamptz`), `bit(n)` and an enum get their column types. An
enum is a `string` whose parameters get its type (`StoreTypeStringMapping`, in the context's file). `timestamptz`
is written as UTC (a local time is made UTC; one of no kind is taken as UTC), and `bit(1)` is a `bool`.
- MySQL: `DATE` and `TIME` are `DateOnly` and `TimeOnly`, through converters (MySql.EntityFrameworkCore reads
`DateTime` and `TimeSpan`).
- A column's default is `HasDefaultValue(5)` for a literal of the property's type, and `HasDefaultValueSql("now()")`
for anything else. EF Core leaves a property at its sentinel (.NET's default: `0`, `null`) out of an insert, so the
database's default is written. A value type's literal default is its sentinel too (`HasSentinel`), so `false`
can still be written where the default is `true`.
- A table's key to itself is named for its column, as EF Core's scaffolding names it: `ParentId`'s navigation is
`Parent`, and the rows that refer to one are `InverseParent`.
- A configuration's class gives way to a table's entity of its name: next to a `ProductConfiguration` table, `Product`'s
is `ProductEntityConfiguration`.
- `Exclude` leaves tables out: no entity, configuration or `DbSet`, and no navigation to them. The default is
`sysdiagrams, __EFMigrationsHistory`, as EF Core's scaffolding leaves those out too.
- The partial classes take your own members, `ConfigurePartial` an entity's own mapping and `OnModelCreatingPartial`
the model's, without editing generated code.

Expand Down