Welcome Guest - Login
PLINQO
home Home
feature-tour Feature Tour
getting-started Getting Started
download Download
documentation Documentation
Forums Forums



Quick Search
»

PoweredBy
Get CodeSmith Free! We want to get the word out about PLINQO and are willing to give CodeSmith away in order to do so. Check out the details!
The Dbml.cst template is used to create a LINQ to SQL dbml file. The file conforms to the Microsoft DbmlSchema.xsd schema. This is the same document that the LINQ to SQL designer uses. The generated dbml file from this template can also be edited from the LINQ to SQL designer.

The template will create a new file if it doesn't exist. If the file does exist, the template will read it in and update it. This allows you to make changes to the file and not have it overwrite if the template is re-ran. However, only some of the attributes are safe from overwriting. Here is a list of safe attributes. They will be listed as an xpath.

Safe Attributes to change in the Dbml file ...

  • Database/@Class - The name of the DataContext class that will be generated.
  • Database/@EntityNamespace - The namespace for the entity classes.
  • Database/@ContextNamespace - The namespace for the DataContext class.
  • Table/@Member - The property name for the table in the DataContext class.
  • Type/@Name - The name of the entity class.
  • Column/@Member - The property name for the column in the entity class.
  • Column/@Storage - The private field LINQ to SQL will us to assign values to.
  • Association/@Member - The property name for this association.
  • Association/@Storage - The private field LINQ to SQL will us to assign values the association to.
  • Association/@DeleteOnNull - Deletes row when association is set to null. Value will not be persisted if the CST's IncludeDeleteOnNull Property is set to false.
  • Function/@Method - The name of the method for the database procedure.
  • Parameter/@Parameter - The method argument name that maps to the database procedure parameter.

Warning: Be aware that the template will drop tables, columns and associations that it did not find in the database.

Properties on the Dbml.cst template:

PropertyDescription
1.Database
CleanExpressionList of regular expressions to clean table, view, column and procedure names. Any matched text found will be removed from the name.
EnumListList of regular expressions to identify an Enum Table.
IgnoreListList of regular expressions used to ignore tables, views and procedures when generating mapping.
IncludeFunctionsInclude stored procedures and user functions in mapping.
IncludeViewsInclude views in mapping.
SourceDatabaseThe source database to generate the dbml file for.
2.Class
ContextNamespaceThe namespace to use for the context class file.
EntityBaseThe base class for the entity.
EntityNamespaceThe namespace to use for the entity class files.
IncludeDeleteOnNullTemplates will generated DeleteOnNull Attribute for Associations.
Naming ConventionsA Menu of options for naming objects in the dbml.
AssociationNamingAdd a list suffix or pluralize associations to an object.
EntityNamingGenerate entity objects in singular or plural form.
TableNamingThe table naming convention followed in the source database.
3.Enum
NameColumnList of regular expressions to identify an Enum Table's Name Column.
DescriptionColummList of regular expressions to identify an Enum Table's Description Column.
4.Mapping
DbmlFileThe path to the dbml file to generate.

Powered by ScrewTurn Wiki version 3.0.1.400.