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 typestring
Default valuenull
Valid valuesMsSql (Microsoft SQL Server)
syntax examples

source.platform.version

Indicates the database platform version.

Data typestring
Default valuenull
Valid valuesany supported version of Microsoft SQL Server
syntax examples

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 typestring
Default valuenull
syntax examples

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 typestring
Default valueinstance
Valid valuesstatic, 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 typestring
Default valuedb
syntax examples

outputDirectory

The outputDirectory option specifies where the generated files will be placed. Values are relative to the location of the config file.

Data typestring
Default valuenull
syntax examples

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 typestring
Default valuenull
syntax examples
Previous
Configuration

© 2024 dbExpression. All rights reserved.