Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

CodeSmith Generator uses the GetFileName method to provide a default output file name for the template when it's called from the CodeSmith Generator Console Application, Template Editor or Master Template. This is also used in CodeSmith Generator as the default file name if you save the output of a template, and anywhere else that CodeSmith Generator needs to assign a filename to the output of your template. You can override this method in your code when you want to build the default file name based on property input or other factors.

...

Using the template defined below we will show off how changing the database table we generate off of, changes the the file path that the template is rendered to.

...

The first step is to create the template above and then specify or download the one attached below. Next, choose a table your wish to generate against by setting configuring the SourceTable Property via the PropertyGrid. In the screenshot below we are choosing a random database table called Account. Once Finally, we click Generate to render the templates contents to a file will be created with the called Account.cs file name.

Image RemovedImage Added

Info
You can download this template by clicking here.