This configuration is used for generating reference-data related code. This is a well understood, deterministic pattern, that is best suited for scenarios where reference-data capabilities are required in a consistent manner.
The CodeGeneration object supports a number of properties that control the generated code output. These properties are separated into a series of logical categories.
| Category | Description |
|---|---|
Primary |
Provides the primary configuration. |
API |
Provides the configuration for the generated API code. |
Repository |
Provides the configuration for the generated repository code. |
Paths |
Provides the configuration for the paths used in code generation. |
Collections |
Provides the collections configuration. |
The properties with a bold name are those that are more typically used (considered more important).
Provides the primary configuration.
| Property | Description |
|---|---|
domain |
The domain name. † This is the .NET domain name. Attempts to default from the underlying data project file path; uses the second to last segment of the child-most sub-directory by convention. For example, /xxx/yyy/My.App.Sales.CodeGen, the domain would be Sales. |
idType |
The default reference data identifier type. Valid options are: String, Guid, Int32, Int64.† Defaults to String. |
collectionSortOrder |
The default reference data collection sort order. Valid options are: Code, Id, Text, SortOrder.† This is the default collection sort order. Defaults to Code. |
Provides the configuration for the generated API code.
| Property | Description |
|---|---|
route |
The route prefix. † Defaults to /api/refdata. |
routeConvention |
The route naming convention where not directly specified. Valid options are: KebabCase, SnakeCase, CamelCase, Lowercase.† Defaults to KebabCase. |
Provides the configuration for the generated repository code.
| Property | Description |
|---|---|
repository |
The default repository implementation. Valid options are: None, EntityFramework. [Mandatory] |
entityFrameworkRepositoryName |
The default Entity Framework (EF) repository parameter name. † This is the .NET Entity Framework (EF) repository parameter name that should be used within the generated code. Defaults to ef. |
Provides the configuration for the paths used in code generation.
| Property | Description |
|---|---|
contractsProjectPath |
The relative path for the .NET contracts-related project. † Defaults to Contracts. |
apiProjectPath |
The relative path for the .NET API-related project. † Defaults to Api. |
applicationProjectPath |
The relative path for the .NET application-related project. † Defaults to Application. |
dataProjectPath |
The relative path for the .NET data-related project. † Defaults to automatic inference using expected name of Infrastructure. |
dataRepositoriesPath |
The path to append to the {DotNetDataProjectPath} for the .NET generated repository code.† Defaults to Repositories. |
dataModelsPath |
The path to append to the {DotNetDataProjectPath} for the .NET generated models code.† Defaults to Persistence. |
dataMappingPath |
The path to append to the {DotNetDataProjectPath} for the .NET generated mapping code.† Defaults to Mapping. |
Provides the collections configuration.
| Property | Description |
|---|---|
entities |
The corresponding Entity collection. |