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.
...
The first step is to create the template above or download the one attached below. Next, choose a table your wish to generate against by configuring the SourceTable Property via the PropertyGrid. In the screenshot below we are choosing a random database table called Account. Finally, we click Generate to render the templates contents to a file called Account.cs file name.
Info |
---|
You can download this template by clicking here. |