Data Access has been discontinued. Please refer to this page for more information.

Model Names

This article is relevant to entity models that utilize the deprecated Visual Studio integration of Telerik Data Access. The current documentation of the Data Access framework is available here.

The Model Names tab page enables you to specify various naming settings and rules to be applied on the generated domain model classes, properties, fields and navitation properties.

The Model Names tab consists of three parts - naming rules for classes, properties, fields and navitation properties.

Changing the settings in the Model Settings dialog won't affect the already generated persistent classes. However, if you include new entities by using the Update from Database Wizard, the new persistent classes, fields and properties will be generated respecting the new naming settings. For more information, please refer to Modifying Naming Settings.

Naming Rules for Classes

The Classes tab pages offers the following options:

  • Add prefix - specifies a prefix to be added to the generated objects.
  • Add suffix - specifies a suffix to be added to the generated objects.
  • Remove prefix(es) - specifies a prefix to be removed from the generated classes. The wizard allows you to remove multiple prefixes. For that purpose, the values in the Remove prefix(es) text box should be separated with a comma or semicolon separator.
  • Remove suffix(es) - specifies a suffix to be removed from the generated classes. The wizard allows you to remove multiple suffixes. For that purpose, the values in the Remove suffix(es) text box should be separated with a comma or semicolon separator.
  • Case - controls the object casing. The following options are available:
    • Unchanged - no changes will be applied. This is the default value.
    • Capitalize - generates all objects with its first letter as uppercase letter.
    • Camel Case - a practice of writing compound words in which the elements are joined without spaces, with each element's initial letter is capitalized. The first letter is a lowercase letter.
    • Pascal Case - a practice of writing compound words in which the elements are joined without spaces, with each element's initial letter is capitalized. The first letter is an uppercase letter.
    • Lower - all objects are generated in lowercase.
    • Upper - all objects are generated in uppercase.
  • Pluralization - controls the object pluralization. The following options are available:
    • Unchanged - no changes will be applied. This is the default value.
    • Singularize - in order to understand correctly this option, consider the following situation: If you have a table named Products in the database, and the pluralization option is set to Singularize, the generated entity will be Product. The wizard "assumes" that your tables are in plural form and will try to make the generated classes in singular form.
    • Pluralize - in order to understand correctly this option, consider the following situation: If you have a table named Product in the database, and the pluralization option is set to Pluralize, the generated entity will be Products. The wizard "assumes" that your tables are in singular form and will try to make the generated classes in plural form.
  • Remove Underscores - removes underscores from the object name.
  • Treat Underscore as Word Delimiter - the idea behind this option is the following: in cases when a table contains underscores usually they are used to divide the words in the name, for instance "Order_Details". Usually this "Treat Underscore as Word Delimiter" option is used together with the CamelCase or PascalCase modes where each word in the name, should begin with a capital letter. Having this in mind, by default "Order_Details" would be considered one word. So by enabling this option you claim that the underscore character are not part of the words but are their delimiters and "Order_Details" are two words. At the end, if this option is enabled and PascalCase or CamelCase mode is selected, the end result should be "OrderDetail" as a class name, instead of "Orderdetail" or "Order_detail".
  • Treat Capital Letters as Word Delimiter - treats every capital letter as the start of a new word.
  • Add Schema Name as Prefix - adds the database schema name as a prefix to the generated objects. This is useful when generating objects from more than one schema.
  • Test group box - here a sample text is shown, illustrating the naming convention for the generated fields.
  • Preview Result - the Preview Result area allows you to see how the corresponding element (class, property or field) looks before and after any settings are specified. You could change the Sample Text text field and see what will be the name of the generated entity considering the specified naming settings.

Naming Rules for Navigation Properties

The Navigations tab exposes settings which allow you to customize the naming rules for navigation properties in one to many association:

  • Base Reference Name On - using this setting you can specify on which string should the name of the reference navigation property be based on. The following choices are available:
    • Class - the name of the reference navigation property will be based on the name of the class at the opposite end of the association. This is the option selected by default.
    • Foreign Key Property - the name of the reference navigation property will be based on the name of the foreign key property found in the same class.
  • Base Collection Name On - this setting allows you to specify which string should be used to generate the name of the collection navigation property. You can choose from the following options:
    • Class - the name of the collection navigation property will be based on the name of the class at the opposite end of the association. This is the option selected by default.
    • Class_ForeignKeyProperty - the name of the collection navigation property will be based on a combination of the names of the class at the opposite end of the association and its foreign key property.
    • ForeignKeyProperty_Class - the name of the collection navigation property will be based on a combination of the name of the foreign key property of the class at the opposite end of the association and the name of the class.
  • Add Prefix to Foreign Key - allows you to add a prefix to the foreign key name part of the names of navigation properties.
  • Add Suffix to Foreign Key - allows you to add a suffix to the foreign key name part of the names of navigation properties.
  • Remove Prefix(es) from Foreign Key - allows you to remove prefixes from the foreign key part of the names of navigation properties.
  • Remove Suffix(es) from the Foreign Key - allows you to remove suffixes from the foreign key part of the names of navigation properties.
  • Foreign Key Reference Pluralization - this setting allows you to change the pluralization of the foreign key part of the names of navigation properties. The following options are available:
    • Unchanged - no changes will be made to the foreign key part of the names of navigation properties. This is the option selected by default.
    • Singularize - if the foreign key part of the names of navigation properties is in plural form it will be singularized.
    • Pluralize - if the foreign key part of the names of navigation properties in in singular form it will be pluralized.
  • Collections Pluralization - with this setting you can change the pluralization of the names of collection navigation properties. The following options are available:
    • Unchanged - the generated name of the collection navigation property will not be modified.
    • Singularize - if the generated name of the collection navigation property is in plural form it will be singularized.
    • Pluralized - if the generated name of the collection navigation property is in singular form it will be pluralized. This is the option selected by default
  • Apply Property Naming Rules on the Reference Side - with this setting you can determine whether to apply the property naming rules when generating the names of your navigation properties. This option is enabled by default. Note that when using Apply Property Naming Rules on the Reference Side, property naming rules are applied before navigation property naming rules.