Using the templates

PLINQO for LINQ to SQL is made up of the following templates. The fastest way to use them is the QuickStart template; see Getting started.

Template What it does
Dbml.cst Creates or updates the LINQ to SQL dbml file from your database.
Entities.cst Generates the DataContext and entity classes from the dbml file.
Managers.cst Generates a manager class for each entity, with common queries and business rules. Optional.
Queries.cst Generates query extension methods for each entity. Optional; an alternative to the managers.
QuickStart.cst Creates a complete Visual Studio solution that uses the other templates.

Add PLINQO to an existing project

If you don't want to use the QuickStart template, for example because you're adding PLINQO 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 (.csp) to the Visual Studio project.
  3. Add an output to the project file for the Dbml.cst template.
  4. Add another output for the Entities.cst template.
  5. Optionally, add an output for the Managers.cst template.
  6. Right-click the project file and clear Output Options > Add Outputs to Project. The templates update the Visual Studio project for you.
  7. Generate the outputs.