Skip to content

Latest commit

 

History

History
79 lines (60 loc) · 4.29 KB

Entity.md

File metadata and controls

79 lines (60 loc) · 4.29 KB

Reference-data entity configuration

Property categories

The Entity 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.
Mapping Provides the configuration for the generated mapping code.
Mutable Provides the configuration for the generated mutability code.
Exclude Provides the configuration for code generation exclusion.
Collections Provides the collections configuration.

The properties with a bold name are those that are more typically used (considered more important).

Primary

Provides the primary configuration.

Property Description
name The reference-data entity (contract) name. [Mandatory]
plural The pluralized reference-data entity (contract) name.
† Defaults to {Name} with the last word pluralized.
text The reference-data entity friendly text.
† Defaults to {Name} converted to sentence case. This is primarily used in generated code comments.
idType The reference-data identifier type. Valid options are: String, Guid, Int32, Int64.
† Defaults to root {IdType}.
collectionSortOrder The collection sort order. Valid options are: Code, Id, Text, SortOrder.
† This is the collection sort order. Defaults to root {CollectionSortOrder}.

API

Provides the configuration for the generated API code.

Property Description
route The route suffix.
† Defaults to {Plural} and root {RouteConvention} configuration.
attribute The optional API controller operation attribute.
† This is the attribute applied as-is to the generated ReferenceDataController operation. This is useful for adding the likes of [Authorize].

Repository

Provides the configuration for the generated repository code.

Property Description
repository The repository implementation. Valid options are: None, EntityFramework, Cosmos.
† Defaults to root {Repository}.
repositoryName The repository parameter name.
† This is the .NET repository parameter name that should be used within the generated code. Defaults from root {Repository} and related configuration.
model The corresponding repository model name.
† Defaults to {Name} (assumes same).
modelPlural The pluralized reference-data model (persistence) name.
† Defaults to {Model} with the last word pluralized.
cosmosPersistenceModel Indicates whether the Cosmos persistence model should also be generated.
† Defaults to root {CosmosPersistenceModel}.

Mapping

Provides the configuration for the generated mapping code.

Property Description
mapper The mapper name.
† This is the .NET mapper name used within the generated code. Defaults to root {Name}Mapper.

Mutable

Provides the configuration for the generated mutability code.

Property Description
mutability The reference-data entity mutability. Valid options are: None, CreateUpdate, CreateUpdateDelete.
† Defaults to None. Requires a Repository of EntityFramework or Cosmos.
validator The validator type name used during mutability operations.
† Defaults to ReferenceDataValidator<{Name}>. Must have a default constructor.
mutableAttribute The mutable API controller class attribute.
† Defaults to [Authorize]. A configured value replaces the default attribute applied as-is to the generated {Name}Controller class.

Exclude

Provides the configuration for code generation exclusion.

Property Description
excludeApi Indicates whether to exclude the generation of the API.
† Defaults to false.
excludeMapper Indicates whether to exclude the generation of the mapper.
† Defaults to false.

Collections

Provides the collections configuration.

Property Description
properties The corresponding Property collection.