3.0 Templates

Contents

Summary

Working with our DAL templates is literally as simple as editing a single line (the database connection) and dropping the files into your project. Visual Studio then takes over and fires off the T4 Templates.

ActiveRecord Templates

If you like Using ActiveRecord then you'll like our templates. They're easy to use and tweak as you need to. You can watch The 5 Minute Demo to see how to add these templates to your project.

Most often people want to mess with naming. You can do that easily by tweaking the CleanUp() method in the top of Settings.ttinclude, or by scrolling down to the Table and Column classes in the same template to see how the naming is handled.

To exclude tables, you can adjust the ExcludeTables array in Settings.ttinclude. It's all C# code so you can, literally, tweak everything as much as needed.

To regenerate your code, simply right-click and select "Run Custom Tool". Or it will run automatically when you change/add the file.

Linq Templates

If you like to monkey with code generation, or have fine control over what you're doing, Using AdvancedTemplates is for you.

These templates were created by George Capnias using the T4 Toolbox by Oleg Sych. Each function is separated out nicely and it's very simple to find the parts of the template that you might want to change.

Working With T4

If you want to tweak the templates, make sure you download the free Clarius T4 Editor