Advanced Capabilities

ExpandedToggleIcon        Custom Templates

At some stage, the capabilities of the existing templates might seem insufficient and you may want to create new templates (based on the blank template) or to extend the existing ones (for that purpose, you can use the Copy-to-model option when adding a template or make the currently added template refer to a template in the resources).

Custom templates can be easily made shared using the "make shared" option. This allows using custom templates in other models. Shared templates are displayed in the Custom category and are stored in the C:\Program Files\Common Files\Devart\EntityDeveloper\Shared Templates folder.

 

ExpandedToggleIcon        Template Editor

Templates are created and edited with convenient editor, which provides context-sensitive code completion, error check, syntax highlighting and other features to speed up your work. All errors and warnings are automatically displayed in the Error List window. The Error List displays an error or warning message and the error location. You can easily navigate to the line that caused the error by double-clicking the error in the Error List window. Thus you may find and fix template errors quickly and conveniently.

 

ExpandedToggleIcon        Advanced Output Configuration

In custom templates you can use the following additional parameters with the PushOutputRedirection function that can be called inside the template code:

the name of the parent project item (the so-called Code Behind). This allows flexibly defining where all generated files should be stored within a large project.
OverwriteBehavior. For partial classes, the new Overwrite Behavior functionality enables the developer to manage how already generated files are treated during subsequent generations. This also allows creating and storing unchanged sample files that can be re-used within a different solution. Using predefined templates enables the fine-tuning of overwrite behavior for code generation. At each generation, it is possible to define whether code should be overwritten, left unchanged or whether the newly generated code is to be appended to the existing one.
BuildAction. In Visual Studio, this capability allows selecting an option of how a file should be processed during compilation.
CopyToOutputDirectory. In Visual Studio, this capability allows selecting an option that defines the circumstances, in which the source code should be placed alongside the compiled file.

 

ExpandedToggleIcon        Extended Properties

At certain stage of development, the existing properties of model objects might not be sufficient. Using Entity Developer you can extend the property lists for objects in the model. These extended properties are either declared in the template, or defined in the model, and then used in code generation. For example, you can add the Generate property to every class and then exclude some classes from generated code by changing the value of this property in the designer.

 

ExpandedToggleIcon        See Also


Send feedback on this topic

© 2008 - 2024 Devart. All rights reserved.