Skip to content

Sample templates name their output's file (GetFileName) - #724

Open
ejsmith wants to merge 1 commit into
9.0from
feat/output-file-names
Open

ejsmith wants to merge 1 commit into
9.0from
feat/output-file-names

Conversation

@ejsmith

@ejsmith ejsmith commented Nov 25, 2026

Copy link
Copy Markdown
Member

The samples' templates for one table now override GetFileName(), returning the name their master template or project already writes:

  • DapperRepositories, TestData: Customer.cs, CustomerRepository.cs, CustomerBuilder.cs, CustomerRepositoryTests.cs
  • ModernEntities (and its copies in Web/FullStack and Frameworks/Csla): Customer.cs, CustomerConfiguration.cs, AppDbContext.cs
  • LookupEnums: Category.cs, category.ts. Lookup.Name gives the enum's name without reading the table.
  • MarkdownDocs: each page's file name, and README.md
  • TableToClass: the record's name

VS Code names a template's output tab after this name, one tab per name: running Record.cst for Account and then Category gives Account output.cs and Category output.cs. Save Output As suggests the same name. A template with no table set falls back to the base name.

What the masters generate is unchanged: Dapper, LookupEnums, MarkdownDocs, ModernEntities, TestData, TableToClass, Csla and FullStack each produced the same files with the old templates and the new ones. Generator's tests that use the samples pass, including the test that the copies stay identical.

…Entities' context, and their copies in FullStack and Csla) name their output's file (GetFileName), as their master templates and projects name it: Customer.cs, CustomerRepository.cs, CustomerConfiguration.cs, category.ts, README.md. VS Code's output tab and Save Output As use the name; what the masters generate is as before
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