Configuration Section
Inside the Configuration object, you define key/value pairs related to code generation.
Here is an example:
{
"Configuration": {
"AutogenSuffix": ".generated",
"Header": "(c) 2020 Dash",
"Templates": [
{
"Template": "./MyTemplate/EfContext",
"Output": "./Ef",
},
{
"Template": "./MyTemplates/Poco",
"Output": "./Poco"
}
]
}
}
Note
If Configuration or any of its key/value pairs are not defined, then default values will be used instead.
AutogenSuffix
The value that will be appended after the filename, and prepended before the extension to indicate that the file was auto-generated.
data type: string
default: .generated
Header
The header that will be injected as comments in every generated file.
data type: string
default:
<auto-generated>This code was generated by dotnet dash CLI. Manual changes to this file will be overwritten if the code is regenerated.</auto-generated>
Pluralize
Pluralize generated class property names. This only applies when a class property is a collection.
data type: boolean
default:
true
!! note
Only English pluralization is supported
Templates
Specify the templates that will be used for code generation.
data type: Array of Template objects
default:
[
{
"Template": "dash://efpoco",
"Output": ".",
},
{
"Template": "dash://efcontext",
"Output": "."
}
]
Template Object
Each Template object is used to reference a single Built-in Template or Custom Template.
Dash will use the referenced templates to generate code.
{
"Template": "dash://efpoco",
"Output": "./Poco",
"OneClassPerFile": false
}
Template
The name of the template.
data type: uri
default: No default value
Output
The absolute output file location, or relative to the working directory.
data type: uri
default: .
OneClassPerFile
Specifies whether each entity should be persisted in its own file.
data type: boolean
default: false
URI
To reference Templates (and other types of Resources), you provide a value conform to the Uniform Resource Identifier syntax.
Dash supports the following URI schemes:
| Scheme | Read | Write | Description |
|---|---|---|---|
| dash | Yes | No | Access embedded Dash resources: Built-in Templates |
| file | Yes | Yes | Access local computer resources |
| http(s) | Yes | No | Access external resources (authentication not (yet) supported) |