Skip to content
codesmithtoolsPublic
 
 

Latest commit

 

History

2,987 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CodeSmith Generator samples

Templates and projects for CodeSmith Generator 9.0: the cs command line and the VS Code extension, on Windows, Linux and macOS. Each sample runs as it is, with the one command in its README; the database samples bring their own SQLite database.

Get one with cs sample new <name> (cs sample list lists them), or CodeSmith: New from Sample... in VS Code. Or clone this repository.

Start here

Sample What it does
HelloWorld A template that writes a class, and a project that generates two.
TableToClass A C# record for each table of a database.

Database

Sample What it does
ModernEntities EF Core entities, their configurations and a DbContext.
DapperRepositories A record and an async Dapper repository for each table.
TestData Test data builders (Bogus) and xUnit tests for each table's Dapper repository.
MarkdownDocs Markdown documentation of a database, with a Mermaid diagram of its tables.
DBDocumenter HTML documentation of a database's tables, views and procedures.
ScriptTableData An INSERT script of a table's rows.
LookupEnums A C# enum and a TypeScript const from a lookup table's rows.

Web

Sample What it does
FullStack EF Core entities, an ASP.NET Core minimal API and a TypeScript client from one database.

Frameworks

Sample What it does
Csla CSLA .NET 10 business objects, their DAL and its EF Core implementation, regenerated as the schema changes.

Examples

Sample What it shows
BasicSamples The template language, a feature at a time (C# and VB).
Merge Regenerating into files with hand-written code (PreserveRegions, InsertRegion).
Xml XML input typed by a schema (<%@ XmlProperty %>).
JsonToClasses Classes from a JSON document.
Maps Type maps (<%@ Map %>).