Using the templates

The fastest way to use the CSLA templates is the QuickStart template; see the Getting started tutorial. These pages cover the main templates:

Template What it does
Entities.cst Generates CSLA business objects, and their data access, from your database.
QuickStart.cst Creates a complete Visual Studio solution that uses the Entities template.

Add the templates to an existing project

If you don't want to use the QuickStart template, for example because you're adding CSLA to an existing or new project, add the templates to a Generator project yourself:

  1. Create a Class Library project in Visual Studio, or open an existing one.
  2. Add a CodeSmith Generator project file to the Visual Studio project.
  3. Add an output for the Entities.cst template:
    1. In Solution Explorer, right-click the Generator project file you added in step 2.
    2. Select Add Output.
    3. In the Add Output dialog, choose the Entities.cst template and click OK.
  4. If you use an Object Factory data access implementation, also add an output for the DataAccessLayer\DataAccessLayer.cst template, the same way.
  5. Generate the outputs: in Solution Explorer, right-click the Generator project file and select Generate Outputs.

The Entities.cst template is in the CSharp\BusinessLayer folder of the CSLA templates for C#, and in the VisualBasic\BusinessLayer folder for Visual Basic.