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

Code Generation Settings

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 Code Generation Settings screen allows you to configure the code generation for the Fluent Model.

The Setup Database Connection dialog will appear only if the selected Fluent Model type is Populate from Database

The Code Generation Settings screen exposes the following settings:

  • Code Generation Templates - from here you can choose which code generation templates to be used for the Fluent Model.
    • Use the Default - when this option is selected the default code generation templates will be used. This option is used by default.
    • Custom Defined - allows you to select modified code generation templates to generate the Fluent Model.
    • Download additional code generation templates online - from this link you can download modified code generation templates from our GitHub repository.
  • Code Generation Options - contains various settings for the classes generated by the wizard:
    • Overwrite Existing Files - when selected, files having the same name will be overwritten. This option is enabled by default.
    • Generate Context - when this option is enabled a context class (deriving from the OpenAccessContext class) will be generated from the model. This option is enabled by default.
    • Generate DataAnnotation Attributes - allows you to generate persistent classes that have their properties decorated with RequiredAttribute, KeyAttribute and StringLengthAttribute as required by the specific properties.
    • Implement INotifyPropertyChanged - when this option is enabled the generated persistent classes will implement the INotifyPropertyChanged interface.
    • Implement INotifyPropertyChanging - when this option is enabled the generated persistent classes will implement the INotifyPropertyChanging interface.
    • Implement IDataErrorInfo - when this option is enabled the generated persistent class will implement the IDataErrorInfo interface.
    • Implement ISerializable - when this option is enabled the generated persistent class will implement the ISerializable interface and be decorated with SerializableAttribute.
      • Ignore Reference Associations - when this option is enabled reference navigation properties will not be serialized. This option is enabled by default.
      • Ignore Collection Associations - when this option is enabled collection navigation properties will not be serialized. This option is enabled by default.
  • File Options - from here you can modify how the files of your Fluent Model will be generated.
    • Generate Multiple Files - when this option is enabled the classes of the model will be generated in a separate file. When disabled all of the classes will be generated in a single file which has the same name as the model. This option is enabled by default.
    • Project Folder - this option specifies that the files of the Fluent Model should be generated in the root of the project or in a specific folder of the project. It is selected by default.
    • File Folder - this option allows you to specify a folder outside the project where the files of the Fluent Model would be generated.
    • Generated in Nested Namespaces - when this option is selected, the persistent classes will be generated in folders according to their namespaces.