Skip to content

Samples: FullStack and Csla take real schemas, template warnings, PLINQO fixes (dogfood round 4) - #725

Open
ejsmith wants to merge 21 commits into
9.0from
fix/pending-2026-11-25
Open

ejsmith wants to merge 21 commits into
9.0from
fix/pending-2026-11-25

Conversation

@ejsmith

@ejsmith ejsmith commented Nov 26, 2026 •

Copy link
Copy Markdown
Member

Samples for Generator PR #22. Merge this one first: #22 points Samples at its head.

Dogfood round 4 (2026-11-26)

  • Shared EF Core templates (ModernEntities, plus FullStack's and Csla's byte-identical copies):
    • PostgreSQL timestamp, bit(n) and enum columns get their store types (an enum's parameter typed as the enum), and timestamptz is written as UTC.
    • A bit(1) column is a bool.
    • MySQL DATE and TIME columns use converters.
    • Column defaults become HasDefaultValue/HasDefaultValueSql.
    • Self-references are Parent/InverseParent.
    • Exclude leaves tables out of the entities, configurations and DbContext (sysdiagrams and __EFMigrationsHistory by default).
    • Clashing names give way (ProductEntityConfiguration).
  • FullStack:
    • Arrays are lists, and bit(n) is text of 0s and 1s.
    • Enums are selects and SETs multi-selects, and the API checks the value (a 400 for a bad one).
    • Search escapes with !, so MySQL search works, and a failed search shows a toast.
    • Defaulted columns are optional on create.
    • Keys with . and / work.
    • Rows fall back to a unique text column for display.
    • Generated types give way with a Record suffix.
    • One Exclude in FullStack.csp.
    • The README has "Your own database" and a "Supported, and not" table, example.ts names no table, and warnings say what the app does instead.
  • Csla:
    • Arrays are read-only MobileLists.
    • Unsigned keys are parsed by the page.
    • A junction table's parent is the table its key starts with.
    • Load, save and delete errors are logged and classified, with the database's message in Development.
    • Name clashes give way.
    • Enum selects.
    • README steps, warnings, and a "Supported, and not" table.
  • Shared: NameWords.Label keeps acronyms (VIP, SKU, ID) and leaves Desc as written.
  • Dropped tables: Entities.cst and TableToClass's Records.cst remove the files of tables that are gone.
  • PLINQO:
    • Dbml.cst saves the dbml with its defaults filled in, so cs check passes right after the first generate.
    • The EF sample's .csp no longer warns.
    • README.md replaces Readme.url.
  • DBDocumenter: the title and server come from the database unless the project sets them.

Earlier in this PR

  • FullStack takes any column's name (From → FromEntity, …), and keyword-named keys get Value.
  • LookupEnums and Csla warn at generation time with CodeTemplate.Warning (CSG0007).
  • Csla generated from a schema snapshot is set up for the snapshot's database.

Verified by Generator's suite: the sample-output tests build the generated apps against each database.

…es on its records (From, ToEntity, ApplyTo, or a record's own name) keeps its name and the member gives way (FromEntity, CreateEntity, ApplyToEntity, TripResponseRecord: the API didn't compile, CS0102 and CS0542); a key's or a filter's parameter named like a C# or TypeScript keyword (debugger, eval, arguments) or like the endpoints' and the client's own names (db, request, entity, row, call, items, total, the UI's q) gets Value (a filter: Filter) after it, and a number where another column's has that name; and the kit's form reads its maps' own entries, so a field named constructor or valueOf isn't shown as wrong from the start
… (CSG0007, at the template's line): LookupEnums' table with no rows (the C#'s #warning, which only a build showed, is a comment now, as the TypeScript's was), and Csla's web app from a database it isn't wired for, when it writes Program.cs, which keeps its #warning at the line to change for whoever builds it
…mbers, file-scoped namespaces, init, nameof and interpolated or raw strings in attributes; VB's auto-implemented properties and attributes without _), whose Metadata attributes Entities.cst copies as written; 8.x read them as C# 3 and VB 9 only
…ken from (the provider's Name, which a snapshot's provider gives as the one it was taken with, not its type, SnapshotSchemaProvider)
… map what each database's provider can't take as it is, and as EF Core's scaffolding writes it: PostgreSQL's timestamp, bit(n) and enums get their column types (an enum's parameters its type), timestamptz is written as UTC, a bit(1) is a bool and MySQL's DATE and TIME are DateOnly and TimeOnly through converters; a column's default is HasDefaultValue or HasDefaultValueSql, with a value type's literal default as its sentinel; a table's own key to itself is named for its column (Parent, InverseParent); Exclude leaves tables out of the entities, configurations and DbContext (sysdiagrams and __EFMigrationsHistory by default, as the scaffolding does); and an entity's configuration gives way to a table's entity of that name (ProductEntityConfiguration)
… map what each database's provider can't take as it is, and as EF Core's scaffolding writes it: PostgreSQL's timestamp, bit(n) and enums get their column types (an enum's parameters its type), timestamptz is written as UTC, a bit(1) is a bool and MySQL's DATE and TIME are DateOnly and TimeOnly through converters; a column's default is HasDefaultValue or HasDefaultValueSql, with a value type's literal default as its sentinel; a table's own key to itself is named for its column (Parent, InverseParent); Exclude leaves tables out of the entities, configurations and DbContext (sysdiagrams and __EFMigrationsHistory by default, as the scaffolding does); and an entity's configuration gives way to a table's entity of that name (ProductEntityConfiguration)
… as written, not only its attributes: the attributes with the #if lines around them and the comments between them, and the declaration (?, init, required, =>, an initializer), at the class's indentation (CodeFileParser.GetSection with an indentation), so a #nullable enable file builds without new CS8618 warnings and a debug-only attribute stays debug-only; a new column's member is written as 8.x wrote it, an 8.x file comes out the same, and the WARNING comment is indented as the members are (8.x: one space more, which dotnet format changed back on every run)
…nString", DeleteOnNull="false") before saving it, as the generator does for a dbml it reads, so a new project's first generate writes what the second does and cs check right after it is up to date (8.x added them on the second run)
…d InclusionMode, which its Entity.cst doesn't have (their code is commented out), so it generates without two warnings on every run
…t generating again keeps: each member as written, #if lines around its attributes, the file's indentation; what it doesn't) and links to the migration guide's framework templates in CI, in place of Readme.url, whose page is gone; the Legacy README says the generated code builds with the .NET SDK anywhere and runs on Windows
… so they agree: an acronym is in capitals (IsVip: VIP, SKU, ID), a bool's label leaves out its Is, Desc stays Desc (a sort's direction as often as a description), and Csla spells out what FullStack did (Ship address 1, not Ship addr 1)
…ties.cst remove the files their last run listed in Files.txt that this one doesn't write (RemoveOutput), so a dropped table's record, entity and configuration go, and cs check reports them; they stayed and still compiled into the app
…gs text of 0s and 1s, enums and MySQL SETs selects the API checks (CS_EnumValues); a column with a default may be left out of a new row; the search escapes with ! (MySQL's ESCAPE '\' was a syntax error) and a failed one says so; a key's last text column is a catch-all and the UI's fallback takes every path; a row is shown by a unique text column and a foreign key not named for its table by its column; a table named like a generated type makes that type give way; one Exclude for every output; timestamptz in the browser's time; warnings for what it can't do, and a README that says what's supported and how to use your own database
…s undo can copy (MobileList) and a list field, bit(n) a string of 0s and 1s, enums a select (a SET check boxes), a key a route has no type for (MySQL's unsigned keys) is parsed by its page, a junction table's parent is the table its key starts with (in column order, the same from every database), a type made for a table gives way to another table's of that name (ProductReadOnlyInfo), Exclude leaves a table out of the EF Core layer too, a page that fails logs it and says why the database refused (with its words in Development), generating warns about what the app does differently, and the README's "Your own database" lists every step, with a "Supported, and not" table
…r its connection names (or its file) unless its project sets them; the sample's project no longer sets PetShop and PetShop.db3, which it showed for any database
…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
# Conflicts:
#	Templates/Database/ModernEntities/Entities.cst
#	Templates/Web/FullStack/Entities.cst
@ejsmith ejsmith changed the title Samples: FullStack takes any column's name, templates warn at generation time, Csla from snapshots Samples: FullStack and Csla take real schemas, template warnings, PLINQO fixes (dogfood round 4) Nov 26, 2026
…n create even when the row sends null (EF Core can't tell null from left out); an update sets it to null after
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant