Reference > Configuration > Scaffolding
General Options
The following pseudo-json shows the various general properties available in the scaffold configuration file:
{
"source": {
"platform" : {
"key": "{key}",
"version": "{version}"
}
},
"rootNamespace": "{rootNamespace}",
"outputDirectory": "{outputDirectory}",
"workingDirectory": "{workingDirectory}",
"runtime": {
"strategy": "{strategy}",
"databaseAccessor": "{databaseAccessor}"
}
}
source
The source
option specifies the database platform and version the code generation process will use while generating scaffolding. dbExpression uses version specific services by default, so it is important to use the correct value for version.
dbExpression uses version specific services, so it is important to use the correct version of Microsoft SQL Server.
source.platform.key
Indicates the database platform. Currently, the only supported value is MsSql
.
Data type | string |
Default value | null |
Valid values | MsSql (Microsoft SQL Server) |
source.platform.version
Indicates the database platform version.
Data type | string |
Default value | null |
Valid values | any supported version of Microsoft SQL Server |
rootNamespace
The rootNamespace
option specifies the prefix of namespaces generated in scaffolded code. dbExpression uses the following namespaces in the scaffold code:
{rootNamespace}.{databaseName}Data
{rootNamespace}.DataService
{rootNamespace}.{schemaName}DataService
When providing a value for rootNamespace
, provide a value that means something in your domain.
Data type | string |
Default value | null |
runtime
Optional, and is only required when you intend to use dbExpression statically. This option effects the scaffolded code that is generated using dbex gen
.
The runtime
section specifies how you intend to use dbExpression at runtime, either statically or with instance based services via dependency injection. If this section is omitted, you are specifying to use dbExpression with dependency injection.
Omit this section if you intend to use dbExpression with dependency injection
runtime.strategy
Specifies whether you intend to use dbExpression with a static database accessor (static
) or with dependency injection (instance
).
Data type | string |
Default value | instance |
Valid values | static , instance |
runtime.databaseAccessor
This option is only relevant when using dbExpression with a static
strategy.
The databaseAccessor
option specifies the typename of the scaffolded static database. When providing a value for databaseAccessor
, provide a value that means something in your domain.
Data type | string |
Default value | db |
outputDirectory
The outputDirectory
option specifies where the generated files will be placed. Values are relative to the location of the config file.
Data type | string |
Default value | null |
workingDirectory
The workingDirectory
option specifies the working directory of the scaffold generation process. Use the workingDirectory
option when the outputDirectory
value should be relative to this value.
Data type | string |
Default value | null |