File match entity.beef-5.yaml entity.beef-5.yml entity.beef-5.json refdata.beef-5.yaml refdata.beef-5.yml refdata.beef-5.json datamodel.beef-5.yaml datamodel.beef-5.yml datamodel.beef-5.json *.entity.beef-5.yaml *.entity.beef-5.yml *.entity.beef-5.json *.refdata.beef-5.yaml *.refdata.beef-5.yml *.refdata.beef-5.json *.datamodel.beef-5.yaml *.datamodel.beef-5.yml *.datamodel.beef-5.json
Schema URL https://catalog.lintel.tools/schemas/schemastore/beef-entity-v5-codegen/latest.json
Source https://raw.githubusercontent.com/Avanade/Beef/master/tools/Beef.CodeGen.Core/Schema/entity.beef-5.json

Validate with Lintel

npx @lintel/lintel check

All of

Definitions

CodeGeneration object

The CodeGeneration object defines global properties that are used to drive the underlying entity-driven code generation.

withResult boolean

Defaults to true. This can be overridden within the Entity(s) and/or Operation(s).

preprocessorDirectives boolean
refDataNamespace string

Defaults to Company + . (literal) + AppName + .Business.Entities (literal).

refDataCommonNamespace string

Defaults to Company + . (literal) + AppName + .Common.Entities (literal).

refDataText boolean

This is used where serializing within the Web API Controller and the ExecutionContext.IsRefDataTextSerializationEnabled is set to true (which is automatically set where the url contains $text=true). This can be further configured on the Entity and for each Property.

refDataType string

Required to identify an entity as being Reference Data. Specifies the underlying .NET Type used for the Reference Data identifier. Results in all underlying entities becoming Reference Data.

Values: "int" "long" "Guid" "string"
refDataWebApiRoute string
refDataDataCtorParams string[]

Each constructor parameter should be formatted as Type + ^ + Name; e.g. IConfiguration^Config. Where the Name portion is not specified it will be inferred. Where the Type matches an already inferred value it will be ignored.

jsonSerializer string

Defaults to SystemText. This can be overridden within the Entity(s).

Values: "SystemText" "Newtonsoft"
etagJsonName string

Defaults to etag. Note that the JsonName can be set individually per property where required.

Values: "etag" "eTag" "_etag" "_eTag" "ETag" "ETAG"
usingNamespace1 string

Typically used where referening a Type from a Namespace that is not generated by default.

usingNamespace2 string

Typically used where referening a Type from a Namespace that is not generated by default.

usingNamespace3 string

Typically used where referening a Type from a Namespace that is not generated by default.

webApiAuthorize string

This can be overridden within the Entity(s) and/or their corresponding Operation(s).

webApiAutoLocation boolean

This will automatically set the Operation.WebApiLocation for an Operation named Create where there is a corresponding named Get. This can be overridden within the Entity(s).

webApiRoutePrefix string
webApiTags string[]

This can be overridden within the Entity(s) and/or their corresponding Operation(s).

managerCleanUp boolean

This can be overridden within the Entity(s) and Operation(s).

validationFramework string

Defaults to CoreEx (literal). This can be overridden within the Entity(s), Operation(s) and Parameter(s).

Values: "CoreEx" "FluentValidation"
autoImplement string

Defaults to None. Indicates that the implementation for the underlying Operations will be auto-implemented using the selected data source (unless explicitly overridden). When selected some of the related attributes will also be required (as documented). Additionally, the AutoImplement can be further specified/overridden per Operation.

Values: "Database" "EntityFramework" "Cosmos" "OData" "HttpAgent" "None"
databaseType string

Defaults to IDatabase. Should be formatted as Type + ^ + Name; e.g. IDatabase^Db. Where the Name portion is not specified it will be inferred. This can be overridden within the Entity(s).

databaseSchema string

Defaults to dbo.

databaseProvider string

Defaults to SqlServer. Enables specific database provider functionality/formatting/etc. where applicable.

Values: "SqlServer" "MySQL" "Postgres"
databaseMapperEx boolean

Defaults to true. The DatabaseMapperEx essentially replaces the DatabaseMapper as it is more performant (extended/explicit); this option can be used where leagcy/existing behavior is required.

entityFrameworkType string

Defaults to IEfDb. Should be formatted as Type + ^ + Name; e.g. IEfDb^Ef. Where the Name portion is not specified it will be inferred. This can be overridden within the Entity(s).

cosmosType string

Defaults to ICosmosDb. Should be formatted as Type + ^ + Name; e.g. ICosmosDb^Cosmos. Where the Name portion is not specified it will be inferred. This can be overridden within the Entity(s).

odataType string

Defaults to IOData. Should be formatted as Type + ^ + Name; e.g. IOData^OData. Where the Name portion is not specified it will be inferred. This can be overridden within the Entity(s).

httpAgentType string

Defaults to IHttpAgent. Should be formatted as Type + ^ + Name; e.g. IHttpAgent^HttpAgent. Where the Name portion is not specified it will be inferred. This can be overridden within the Entity(s).

etagDefaultMapperConverter string

Defaults to StringToBase64Converter.

refDataDefaultMapperConverter string

Defaults to ReferenceDataCodeConverter<T>. Where this value is suffixed by <T> or {T} this will automatically be set to the Type.

Values: "ReferenceDataCodeConverter" "ReferenceDataCodeConverter{T}" "ReferenceDataCodeConverter<T>" "ReferenceDataIdConverter{T, int}" "ReferenceDataIdConverter<T, int>" "ReferenceDataIdConverter{T, int?}" "ReferenceDataIdConverter<T, int?>" "ReferenceDataIdConverter{T, long}" "ReferenceDataIdConverter<T, long>" "ReferenceDataIdConverter{T, long?}" "ReferenceDataIdConverter<T, long?>" "ReferenceDataIdConverter{T, Guid}" "ReferenceDataIdConverter<T, Guid>" "ReferenceDataIdConverter{T, Guid?}" "ReferenceDataIdConverter<T, Guid?>" "ReferenceDataInt32IdConverter" "ReferenceDataInt32IdConverter{T}" "ReferenceDataInt32IdConverter<T>" "ReferenceDataNullableInt32IdConverter" "ReferenceDataNullableInt32IdConverter{T}" "ReferenceDataNullableInt32IdConverter<T>" "ReferenceDataInt64IdConverter" "ReferenceDataInt64IdConverter{T}" "ReferenceDataInt64IdConverter<T>" "ReferenceDataNullableInt64IdConverter" "ReferenceDataNullableInt64IdConverter{T}" "ReferenceDataNullableInt64IdConverter<T>" "ReferenceDataGuidIdConverter" "ReferenceDataGuidIdConverter{T}" "ReferenceDataGuidIdConverter<T>" "ReferenceDataNullableGuidIdConverter" "ReferenceDataNullableGuidIdConverter{T}" "ReferenceDataNullableGuidIdConverter<T>"
refDataCodeDataName string

Defaults to Code (literal).

refDataTextDataName string

Defaults to Text (literal).

refDataIsActiveDataName string

Defaults to IsActive (literal).

refDataSortOrderDataName string

Defaults to SortOrder (literal).

refDataETagDataName string

Defaults to RowVersion (literal).

eventPublish string

Defaults to DataSvc. Used to enable the sending of messages to the likes of EventHub, ServiceBus, SignalR, etc. This can be overridden within the Entity(s).

Values: "None" "DataSvc" "Data"
eventSourceRoot string

The event source is only updated where an EventSourceKind is not None. This can be extended within the Entity(s).

eventSourceKind string

Defaults to None (being the event source is not updated).

Values: "None" "Absolute" "Relative" "RelativeOrAbsolute"
eventSubjectRoot string

Used to enable the sending of messages to the likes of EventHub, ServiceBus, SignalR, etc. This can be overridden within the Entity(s).

eventSubjectSeparator string

Defaults to .. Used only where the subject is automatically inferred.

eventActionFormat string

Defaults to None (no formatting required, i.e. as-is)`.

Values: "None" "PastTense"
eventTransaction boolean

Usage will force a rollback of any underlying data transaction (where the provider supports TransactionScope) on failure, such as an EventPublish error. This is by no means implying a Distributed Transaction (DTC) should be invoked; this is only intended for a single data source that supports a TransactionScope to guarantee reliable event publishing. Defaults to false. This essentially defaults the Entity.EventTransaction where not otherwise specified. This should only be used where EventPublish is DataSvc and a transactionally-aware data source is being used.

grpc boolean

gRPC support is an explicit opt-in model. Must be set to true for any of the subordinate gRPC capabilities to be code-generated. Will require each Entity, and corresponding Property and Operation to be opted-in specifically.

pathBase string

Defaults to Company (runtime parameter) + . + AppName (runtime parameter). For example Beef.Demo.

pathCommon string

Defaults to PathBase + .Common (literal). For example Beef.Demo.Common.

pathBusiness string

Defaults to PathBase + .Business (literal). For example Beef.Demo.Business.

pathApi string

Defaults to PathBase + . + ApiName (runtime parameter). For example Beef.Demo.Api.

namespaceBase string

Defaults to Company (runtime parameter) + . + AppName (runtime parameter). For example Beef.Demo.

namespaceCommon string

Defaults to NamespaceBase + .Common (literal). For example Beef.Demo.Common.

namespaceBusiness string

Defaults to NamespaceBase + .Business (literal). For example Beef.Demo.Business.

namespaceApi string

Defaults to NamespaceBase + . + ApiName (runtime parameter). For example Beef.Demo.Api.

authActionCreate string

Defaults to Create.

authActionRead string

Defaults to Read.

authActionUpdate string

Defaults to Update.

authActionDelete string

Defaults to Delete.

entities Entity[]
Entity object

The Entity is used as the primary configuration for driving the entity-driven code generation.

name string required
text string

Overrides the Name (as sentence text) for the summary comments. It will be formatted as: Represents the {Text} entity.. To create a <see cref="XXX"/> within use moustache shorthand (e.g. {{Xxx}}). To have the text used as-is prefix with a + plus-sign character.

fileName string

Overrides the Name as the code-generated file name.

privateName string

Overrides the Name to be used for private fields. By default reformatted from Name; e.g. FirstName as _firstName.

argumentName string

Overrides the Name to be used for argument parameters. By default reformatted from Name; e.g. FirstName as firstName.

constType string

The .NET Type to be used for the const values. Defaults to string.

Values: "int" "long" "Guid" "string"
isInitialOverride boolean

Set to either true or false to override as specified; otherwise, null to check each property. Defaults to null.

withResult boolean

Defaults to CodeGeneration.WithResult. This can be overridden within the Operation`(s).

refDataType string

Required to identify an entity as being Reference Data. Specifies the underlying .NET Type used for the Reference Data identifier.

Values: "int" "long" "Guid" "string"
refDataText boolean

This is used where serializing within the Web APIController and the ExecutionContext.IsRefDataTextSerializationEnabled is set to true (which is automatically set where the url contains $text=true). Defaults from CodeGeneration.RefDataText.

refDataSortOrder string

Specifies the default sort order for the underlying Reference Data collection. Defaults to SortOrder.

Values: "SortOrder" "Id" "Code" "Text"
inherits string

Defaults to EntityBase for a standard entity. For Reference Data it will default to ReferenceDataBaseEx<xxx> depending on the corresponding RefDataType value. See OmitEntityBase if the desired outcome is to not inherit from any of the aforementioned base classes.

implements string
implementsAutoInfer boolean

Will attempt to infer the following: IIdentifier<Guid>, IIdentifier<int>, IIdentifier<long>, IIdentifier<string>, IETag and IChangeLog. Defaults to true.

abstract boolean
genericWithT boolean
namespace string

Appended to the end of the standard structure as follows: {Company}.{AppName}.Business.Entities.{Namespace}.

omitEntityBase boolean

As such any of the EntityBase related capabilites are not supported (are omitted from generation). The intention for this is more for the generation of simple internal entities.

jsonSerializer string

Defaults to the CodeGeneration.JsonSerializer configuration property where specified; otherwise, SystemText.

Values: "SystemText" "Newtonsoft"
internalOnly boolean
collection boolean
collectionResult boolean

Enables the likes of additional paging state to be stored with the underlying collection.

collectionType string
Values: "Standard" "Keyed" "Dictionary"
collectionInherits string

Defaults to EntityBaseCollection or EntityBaseKeyedCollection depending on CollectionKeyed. For Reference Data it will default to ReferenceDataCollectionBase.

collectionResultInherits string

Defaults to EntityCollectionResult.

behavior string

Value may only specifiy one or more of the CGRUDBAQ characters (in any order) to define the automatically generated behavior (operations); for example: CRUPD or CRUP or rba (case insensitive). This is shorthand for setting one or more of the following properties: Get, GetByArgs, GetAll, 'Create', Update, Patch and Delete. Where one of these properties is set to either true or false this will take precedence over the value set for Behavior.

get boolean
getByArgs boolean
getAll boolean
getByQuery boolean
create boolean
update boolean
patch boolean
delete boolean
autoImplement string

Defaults to CodeGeneration.AutoImplement (where RefDataType or EntityFrameworkModel or CosmosModel or HttpAgent is not null; otherwise, None. Indicates that the implementation for the underlying Operations will be auto-implemented using the selected data source (unless explicitly overridden). When selected some of the related attributes will also be required (as documented). Additionally, the AutoImplement can be further specified/overridden per Operation.

Values: "Database" "EntityFramework" "Cosmos" "OData" "HttpAgent" "None"
dataCtor string

Defaults to Public.

Values: "Public" "Private" "Protected"
dataCtorCustom boolean
dataCtorParams string[]

Each constructor parameter should be formatted as Type + ^ + Name; e.g. IConfiguration^Config. Where the Name portion is not specified it will be inferred. Where the Type matches an already inferred value it will be ignored.

dataExtensions boolean

This can be overridden using Operation.DataExtensions.

refDataIdDataName string

Defaults to Name + Id (literal).

refDataCodeDataName string

Defaults to Code (literal).

refDataTextDataName string

Defaults to Text (literal).

refDataIsActiveDataName string

Defaults to IsActive (literal).

refDataSortOrderDataName string

Defaults to SortOrder (literal).

refDataETagDataName string

Defaults to RowVersion (literal).

refDataStoredProcedureName string

Defaults to sp (literal) + Name + GetAll (literal).

databaseType string

Defaults to the CodeGeneration.DatabaseName configuration property (its default value is IDatabase). Should be formatted as Type + ^ + Name.

databaseSchema string

Defaults to dbo.

databaseMapperInheritsFrom string
databaseCustomMapper boolean

Otherwise, by default, a Mapper will be generated.

databaseMapperEx boolean

Defaults to CodeGeneration.DatabaseMapperEx (its default value is true). The DatabaseMapperEx essentially replaces the DatabaseMapper as it is more performant; this option can be used where leagcy/existing behavior is required.

entityFrameworkType string

Defaults to CodeGeneration.EntityFrameworkName. Should be formatted as Type + ^ + Name.

entityFrameworkModel string
entityFrameworkCustomMapper boolean

Otherwise, by default, a Mapper will be generated.

entityFrameworkMapperBase string
cosmosType string

Defaults to the CodeGeneration.CosmosName configuration property (its default value is ICosmosDb). Should be formatted as Type + ^ + Name.

cosmosModel string
cosmosContainerId string
cosmosPartitionKey string

The value PartitionKey.None can be specified. Literals will need to be quoted.

cosmosValueContainer boolean
cosmosCustomMapper boolean

Otherwise, by default, a Mapper will be generated.

cosmosMapperBase string
odataType string

Defaults to the CodeGeneration.ODataName configuration property (its default value is IOData). Should be formatted as Type + ^ + Name.

odataModel string
odataCollectionName string

The underlying Simple.OData.Client will attempt to infer.

odataCustomMapper boolean

Otherwise, by default, a Mapper will be generated.

httpAgentType string

Defaults to CodeGeneration.HttpAgentName configuration property (its default value is IHttpAgent). Should be formatted as Type + ^ + Name.

httpAgentRoutePrefix string

This is the base (prefix) URI for the HTTP Agent endpoint and can be further extended when defining the underlying Operation(s).

httpAgentModel string

This can be overridden within the Operation(s).

httpAgentReturnModel string

This can be overridden within the Operation(s).

httpAgentCode string

Prepended to Operation.HttpAgentCode where specified to enable standardized functionality.

httpAgentCustomMapper boolean

Otherwise, by default, a Mapper will be generated.

httpAgentMapperBase string
dataSvcCaching boolean

Defaults to true.

dataSvcCtor string

Defaults to Public.

Values: "Public" "Private" "Protected"
dataSvcCustom string

Full indicates the logic is fully customized (only invocation is code-generated). Partial indicates combination of surrounding code-generation with final custom invocation versus data-layer. None indicates data-layer invocation with no custom invocation (default).

Values: "Full" "Partial" "None"
dataSvcCtorCustom boolean
dataSvcCtorParams string[]

Each constructor parameter should be formatted as Type + ^ + Name; e.g. IConfiguration^Config. Where the Name portion is not specified it will be inferred. Where the Type matches an already inferred value it will be ignored.

dataSvcExtensions boolean

This can be overridden using Operation.DataSvcExtensions.

eventPublish string

Defaults to the CodeGeneration.EventPublish configuration property (inherits) where not specified. Used to enable the sending of messages to the likes of EventGrid, Service Broker, SignalR, etc. This can be overridden within the Operation(s).

Values: "None" "DataSvc" "Data"
eventSource string

Defaults to Name (as lowercase) appended with the /{$key} placeholder. Note: when used in code-generation the CodeGeneration.EventSourceRoot will be prepended where specified. To include the entity id/key include a {$key} placeholder (Create, Update or Delete operation only); for example: person/{$key}. This can be overridden for the Operation.

eventTransaction boolean

Usage will force a rollback of any underlying data transaction (where the provider supports TransactionScope) on failure, such as an EventPublish error. This is by no means implying a Distributed Transaction (DTC) should be invoked; this is only intended for a single data source that supports a TransactionScope to guarantee reliable event publishing. Defaults to CodeGeneration.EventTransaction. This essentially defaults the Operation.DataSvcTransaction where not otherwise specified. This should only be used where a transactionally-aware data source is being used.

managerCustom boolean
managerCtor string

Defaults to Public.

Values: "Public" "Private" "Protected"
managerCtorCustom boolean
managerCtorParams string[]

Each constructor parameter should be formatted as Type + ^ + Name; e.g. IConfiguration^Config. Where the Name portion is not specified it will be inferred. Where the Type matches an already inferred value it will be ignored.

managerExtensions boolean

This can be overridden using Operation.ManagerExtensions.

validator string

Only used for defaulting the Create and Update operation types (Operation.Type) where not specified explicitly.

identifierGenerator boolean
managerCleanUp boolean

This can be overridden within the CodeGeneration and Operation(s).

validationFramework string

Defaults to CodeGeneration.ValidationFramework. This can be overridden within the Operation(s) and Parameter(s).

Values: "CoreEx" "FluentValidation"
webApiRoutePrefix string

This is the base (prefix) URI for the entity and can be further extended when defining the underlying Operation(s). The CodeGeneration.WebApiRoutePrefix will be prepended where specified. Where not specified will automatically default to the pluralized Name (as lowercase).

webApiAuthorize string

Defaults to the CodeGeneration.WebApiAuthorize configuration property (inherits) where not specified; can be overridden at the Operation level also.

webApiCtor string

Defaults to Public.

Values: "Public" "Private" "Protected"
webApiCtorParams string[]

Each constructor parameter should be formatted as Type + ^ + Name; e.g. IConfiguration^Config. Where the Name portion is not specified it will be inferred. Where the Type matches an already inferred value it will be ignored.

webApiAutoLocation boolean

This will automatically set the Operation.WebApiLocation for an Operation named Create where there is a corresponding named Get. This is defaulted from the CodeGen.WebApiAutoLocation.

webApiConcurrency boolean

This provides an alternative where the underlying data source does not natively support optimistic concurrency (native support should always be leveraged as a priority). Where the Operation.Type is Update or Patch, the request ETag will be matched against the response for a corresponding Get operation to verify no changes have been made prior to updating. For this to function correctly the .NET response Type for the Get must be the same as that returned from the corresponding Create, Update and Patch (where applicable) as the generated ETag is a SHA256 hash of the resulting JSON. This defaults the Operation.WebApiConcurrency.

webApiGetOperation string

Defaults to Get. Specify either just the method name (e.g. OperationName) or, interface and method name (e.g. IXxxManager.OperationName) to be invoked where in a different YyyManager.OperationName.

webApiTags string[]
dataModel boolean

The model will be generated with OmitEntityBase = true. Any reference data properties will be defined using their RefDataType intrinsic Type versus their corresponding (actual) reference data Type.

dataModelInherits string
excludeEntity boolean
excludeAll boolean

Is a shorthand means for setting all of the other Exclude* properties (with the exception of ExcludeEntity) to exclude.

excludeIData boolean
excludeData string

Defaults to Include indicating not to exclude. A value of Exclude indicates to exclude all output; alternatively, RequiresMapper indicates to at least output the corresponding Mapper class.

Values: "Include" "Exclude" "RequiresMapper"
excludeIDataSvc boolean
excludeDataSvc boolean
excludeIManager boolean
excludeManager boolean
excludeWebApi boolean
excludeWebApiAgent boolean
excludeGrpcAgent boolean
authPermission string
authEntity string
authRole string

Used where not overridden specifically for an Operation; i.e. acts as the default.

grpc boolean

gRPC support is an explicit opt-in model (see CodeGeneration.Grpc configuration); therefore, each corresponding Property and Operation will also need to be opted-in specifically.

properties Property[]
operations Operation[]
consts Const[]
Property object

The Property object defines an Entity property and its charateristics.

name string required
text string

By default the Text will be the Name reformatted as sentence casing. Depending on whether the Type is bool, will appear in one of the two generated sentences. Where not bool it will be: Gets or sets a value indicating whether {text}.'. Otherwise, it will be: Gets or sets the {text}.'. To create a <see cref="XXX"/> within use moustache shorthand (e.g. {{Xxx}}). To have the text used as-is prefix with a + plus-sign character.

modelText string

By default the ModelText will be the Name reformatted as sentence casing. Depending on whether the Type is bool, will appear in one of the two generated sentences. Where not bool it will be: Gets or sets a value indicating whether {text}.'. Otherwise, it will be: Gets or sets the {text}.'. To create a <see cref="XXX"/> within use moustache shorthand (e.g. {{Xxx}}). To have the text used as-is prefix with a + plus-sign character.

type string

Defaults to string. To reference a Reference Data Type always prefix with RefDataNamespace (e.g. RefDataNamespace.Gender) or shortcut ^ (e.g. ^Gender). This will ensure that the appropriate Reference Data using statement is used. Shortcut: Where the Type starts with (prefix) RefDataNamespace. or ^, and the correspondong RefDataType attribute is not specified it will automatically default the RefDataType to string.

nullable boolean
inherited boolean
privateName string

Overrides the Name to be used for private fields. By default reformatted from Name; e.g. FirstName as _firstName.

argumentName string

Overrides the Name to be used for argument parameters. By default reformatted from Name; e.g. FirstName as firstName.

primaryKey boolean

This is also used to simplify the parameter specification for an Entity Operation by inferrence.

isEntity boolean

Will be inferred (default to true) where the Type is ChangeLog or the Type is found as another Entity within the code-generation configuration file.

immutable boolean
dateTimeTransform string

Defaults to UseDefault. This is only applied where the Type is DateTime.

Values: "UseDefault" "None" "DateOnly" "DateTimeLocal" "DateTimeUtc" "DateTimeUnspecified"
stringTrim string

Defaults to UseDefault. This is only applied where the Type is string.

Values: "UseDefault" "None" "Start" "End" "Both"
stringTransform string

Defaults to UseDefault. This is only applied where the Type is string.

Values: "UseDefault" "None" "NullToEmpty" "EmptyToNull"
stringCasing string

Defaults to UseDefault. This is only applied where the Type is string.

Values: "UseDefault" "None" "Lower" "Upper" "Title"
autoCreate boolean
default string

Where the Type is string then the specified default value will need to be delimited. Any valid value assignment C# code can be used.

partitionKey boolean

This will implement IPartitionKey for the generated entity.

cacheKey boolean

This will implement ICacheKey for the generated entity.

internalOnly boolean

In this instance the Property will be excluded from the Common entity declaration and Business JSON serialization.

refDataType string

Defaults to string (being the ReferenceDataBase.Code) where not specified and the corresponding Type starts with (prefix) RefDataNamespace. or ^. Note: an Id of type string is currently not supported; the use of the Code is the recommended approach.

Values: "string" "int" "Guid"
refDataList boolean

This is required to enable a list of Reference Data values (as per RefDataType) to be passed as an argument for example.

refDataText string

This is used where serializing within the Web API Controller and the ExecutionContext.IsRefDataTextSerializationEnabled is set to true (which is automatically set where the url contains $text=true).Optional indicates when ExecutionContext.IsRefDataTextSerializationEnabled is set to true then a value is output, Always indicates that the value is always output, and Never indicates that feature is turned off.

Values: "Optional" "Always" "Never"
refDataTextName string
refDataMapping boolean

Mapped properties are a special Reference Data property type that ensure value uniqueness; this allows the likes of additional to/from mappings to occur between systems where applicable.

jsonName string

Defaults to ArgumentName where not specified (i.e. camelCase); however, where the property is ETag it will default to the Config.ETagJsonName.

jsonDataModelName string

Defaults to JsonName where not specified.

serializationIgnore boolean

All properties are serialized by default.

serializationAlwaysInclude boolean
dataModelIgnore boolean

All properties are included in the data model by default.

dataModelSerializationIgnore boolean

All properties are included in the data model by default.

dataName string

Defaults to the property Name. Represents the column name for a Database, or the correspinding property name for the other options.

dataConverter string

A Converter is used to convert a data source value to/from a .NET Type where no standard data conversion can be applied. Where this value is suffixed by <T> or {T} this will automatically set Type.

dataMapperIgnore boolean

All properties are included by default.

dataAutoGenerated boolean
dataOperationTypes string

Defaults to Any.

Values: "Any" "AnyExceptCreate" "AnyExceptUpdate" "AnyExceptGet" "Get" "Create" "Update" "Delete"
databaseMapper string

A Mapper is used to map a data source value to/from a .NET complex Type (i.e. class with one or more properties).

databaseIgnore boolean
databaseDbType string

Overrides the inferred database type; i.e. can specify Date or DateTime2, for .NET Type System.DateTime.

entityFrameworkMapper string

Defaults to Set.

Values: "Set" "Ignore" "Map" "Flatten"
cosmosMapper string

Defaults to Set.

Values: "Set" "Ignore" "Map" "Flatten"
odataMapper string

Defaults to Map which indicates the property will be explicitly mapped. A value of Ignore will explicitly Ignore, whilst a value of Skip will skip code-generated mapping altogether.

Values: "Map" "Ignore" "Skip"
httpAgentMapper string

Defaults to Set.

Values: "Set" "Ignore" "Map" "Flatten"
displayName string

Defaults to the Name as sentence case.

annotation1 string
annotation2 string
annotation3 string
grpcFieldNo integer
grpcType string
Operation object

The code generation for an Operation is primarily driven by the Type property. This encourages (enforces) a consistent implementation for the standardised CRUD (Create, Read, Update and Delete) actions, as well as supporting fully customised operations as required.

name string required
type string

Defaults to Custom.

Values: "Get" "GetColl" "Create" "Update" "Patch" "Delete" "Custom" "CustomManagerOnly"
text string

The Text will be defaulted for all the Operation.Type options with the exception of Custom. To create a <see cref="XXX"/> within use moustache shorthand (e.g. {{Xxx}}). To have the text used as-is prefix with a + plus-sign character.

primaryKey boolean

This simplifies the specification of these properties as parameters versus having to declare each specifically. Each of the parameters will also be set to be mandatory.

paging boolean
query boolean
valueType string

Defaults to the parent Entity.Name where the Operation.Type options are Create or Update.

returnType string

Defaults to the parent Entity.Name where the Operation.Type options are Get, GetColl, Create or Update; otherwise, defaults to void.

returnTypeNullable boolean

Will be inferred where the ReturnType is denoted as nullable; i.e. suffixed by a ?. Additionally a Type of Get will default to true where not specified.

returnText string

A default will be created where not specified. To create a <see cref="XXX"/> within use moustache shorthand (e.g. {{Xxx}}). To have the text used as-is prefix with a + plus-sign character.

privateName string

Overrides the Name to be used for private usage. By default reformatted from Name; e.g. GetByArgs as _getByArgs.

withResult boolean

Defaults to Entity.WilhResult.

autoImplement string

Defaults to Entity.AutoImplement. The corresponding Entity.AutoImplement must be defined for this to be enacted. Auto-implementation is applicable for all Operation.Type options with the exception of Custom.

Values: "Database" "EntityFramework" "Cosmos" "OData" "HttpAgent" "None"
dataEntityMapper string

Used where the default generated Mapper is not applicable.

dataExtensions boolean

Defaults to Entity.DataExtensions.

dataInvoker boolean

Where Dataransaction or EventPublish is Data then orchestration will default to true.

dataTransaction boolean

Where using an EventOutbox this is ignored as it is implied through its usage.

databaseStoredProc string

Defaults to sp + Entity.Name + Operation.Name; e.g. spPersonCreate.

entityFrameworkModel string

Overrides the Entity.EntityFrameworkModel.

cosmosModel string

Overrides the Entity.CosmosModel.

cosmosContainerId string

Overrides the Entity.CosmosContainerId.

cosmosPartitionKey string

Overrides the Entity.CosmosPartitionKey.

odataCollectionName string

Overriddes the Entity.ODataCollectionName; otherwise, the underlying Simple.OData.Client will attempt to infer.

httpAgentRoute string

This is appended to the Entity.HttpAgentRoutePrefix.

httpAgentMethod string

Defaults to Operation.WebApiMethod.

Values: "HttpGet" "HttpPost" "HttpPut" "HttpDelete" "HttpPatch"
httpAgentModel string

This can be overridden within the Operation(s).

httpAgentReturnModel string

Defaults to Operation.HttpAgentModel where the Operation.ReturnType is equal to Entity.Name (same type). This can be overridden within the Operation(s).

httpAgentCode string

Appended to Entity.HttpAgentCode where specified to extend.

managerCustom boolean
managerTransaction boolean
managerExtensions boolean

Defaults to Entity.ManagerExtensions.

validator string

Defaults to the Entity.Validator where not specified explicitly (where Operation.Type options Create or Update).

validationFramework string

Defaults to Entity.ValidationFramework. This can be overridden within the Parameter(s).

Values: "CoreEx" "FluentValidation"
managerOperationType string

The default will be inferred from the Operation.Type; however, where the Operation.Type is Custom it will default to Unspecified.

Values: "Create" "Read" "Update" "Delete" "Unspecified"
managerCleanUp boolean

This can be overridden within the CodeGeneration and Entity.

dataSvcCustom string

Full indicates the logic is fully customized (only invocation is code-generated). Partial indicates combination of surrounding code-generation with final custom invocation versus data-layer. None indicates data-layer invocation with no custom invocation (default).

Values: "Full" "Partial" "None"
dataSvcTransaction boolean
dataSvcInvoker boolean

Where DataSvcTransaction or EventPublish is DataSvc then the orchestration will default to true.

dataSvcExtensions boolean

Defaults to Entity.ManagerExtensions.

eventPublish string

Defaults to the Entity.EventPublish configuration property (inherits) where not specified. Used to enable the sending of messages to the likes of EventGrid, Service Broker, SignalR, etc.

Values: "None" "DataSvc" "Data"
eventValue string

The event value is automatically inferred where the Operation.Type is Create, Update or Delete.

eventSource string

Defaults to Entity.EventSource. Note: when used in code-generation the CodeGeneration.EventSourceRoot will be prepended where specified. To include the entity id/key include a {$key} placeholder (Create, Update or Delete operation only); for example: person/{$key}. Otherwise, specify the C# string interpolation expression; for example: person/{r.Id}.

eventSubject string

The event subject template defaults to {AppName}.{Entity.Name}, plus each of the unique key placeholders comma separated; e.g. Domain.Entity.{id1},{id2} (depending on whether Entity.EventSubjectFormat is NameAndKey or NameOnly). The event action defaults to WebApiOperationType or Operation.Type where not specified. Multiple events can be raised by specifying more than one subject/action pair separated by a semicolon. E.g. Demo.Person.{id}:Create;Demo.Other.{id}:Update.

webApiRoute string

Where the value is specified with a leading ! character this indicates that the Entity.WebApiRoutePrefix should not be used, and the value should be used as-is (with the ! removed).

webApiAuthorize string

Where not specified no attribute output will occur; it will then inherit as supported by .NET.

webApiMethod string

The value defaults as follows: HttpGet for Operation.Type value Get or GetColl, HttpPost for Operation.Type value Create or Custom, HttpPut for Operation.Type value Update, and HttpDelete for Operation.Type value Delete. An Operation.Type value Patch can not be specified and will always default to HttpPatch.

Values: "HttpGet" "HttpPost" "HttpPut" "HttpDelete"
webApiStatus string

The value defaults as follows: OK for Operation.Type value Get, GetColl, Update, Delete or Custom, Created for Operation.Type value Create.

Values: "OK" "Accepted" "Created" "NoContent" "NotFound"
webApiAlternateStatus string

The value defaults as follows: NotFound for Operation.Type of Get, Update, Patch; NoContent for Operation.Type of GetColl; otherwise, none. A value of none indicates that there is no alternate status.

Values: "OK" "Accepted" "Created" "NoContent" "NotFound" "none"
webApiLocation string

This uses similar formatting to the WebApiRoute. The response value is accessed using r. notation to access underlying properties; for example {r.Id} or person/{r.Id}. The Entity.WebApiRoutePrefix will be prepended automatically; however, to disable set the first character to !, e.g. !person/{r.Id}. The URI can be inferred from another Operation by using a lookup ^; for example ^Get indicates to infer from the named Get operation (where only ^ is specified this is shorthand for ^Get as this is the most common value). The Location URI will ensure the first character is a / so it acts a 'relative URL absolute path'.

webApiConcurrency boolean

This provides an alternative where the underlying data source does not natively support optimistic concurrency (native support should always be leveraged as a priority). Where the Operation.Type is Update or Patch, the request ETag will be matched against the response for a corresponding Get operation to verify no changes have been made prior to updating. For this to function correctly the .NET response Type for the Get must be the same as that returned from the corresponding Create, Update and Patch (where applicable) as the generated ETag is a SHA256 hash of the resulting JSON. Defaults to Entity.WebApiConcurrency.

webApiGetOperation string

Defaults to Get. Specify either just the method name (e.g. OperationName) or, interface and method name (e.g. IXxxManager.OperationName) to be invoked where in a different YyyManager.OperationName.

webApiUpdateOperation string

Defaults to Update. Specify either just the method name (e.g. OperationName) or, interface and method name (e.g. IXxxManager.OperationName) to be invoked where in a different YyyManager.OperationName.

webApiProduces string[]
webApiProducesResponseType string

Defaults to the Common type. A value of None, none or `` will ensure no type is emitted.

webApiTags string[]

Overrides the Entity.WebApiTags; unless, if the first tag value is a ^ then this indicates that the Entity.WebApiTags are to be included (inherited) as a replacement. Otherwise, defaults to Entity.WebApiTags.

authPermission string
authEntity string
authAction string
authRole string
excludeAll boolean

Is a shorthand means for setting all of the other Exclude* properties to true.

excludeIData boolean
excludeData boolean
excludeIDataSvc boolean
excludeDataSvc boolean
excludeIManager boolean
excludeManager boolean
excludeWebApi boolean
excludeWebApiAgent boolean
excludeGrpcAgent boolean
grpc boolean

gRPC support is an explicit opt-in model (see CodeGeneration.Grpc configuration); therefore, each corresponding Entity, Property and Operation will also need to be opted-in specifically.

parameters Parameter[]
Parameter object

The Parameter object defines an Operation parameter and its charateristics.

name string required
text string

By default the Text will be the Name reformatted as sentence casing. To have the text used as-is prefix with a + plus-sign character.

type string

Defaults to string. To reference a Reference Data Type always prefix with RefDataNamespace (e.g. RefDataNamespace.Gender) or shortcut ^ (e.g. ^Gender). This will ensure that the appropriate Reference Data using statement is used. Shortcut: Where the Type starts with (prefix) RefDataNamespace. or ^, and the correspondong RefDataType attribute is not specified it will automatically default the RefDataType to string.

nullable boolean
default string

Where the Type is string then the specified default value will need to be delimited. Any valid value assignment C# code can be used.

privateName string

Overrides the Name to be used for private fields. By default reformatted from Name; e.g. FirstName as _firstName.

argumentName string

Overrides the Name to be used for argument parameters. By default reformatted from Name; e.g. FirstName as firstName.

property string
refDataType string

Defaults to string where not specified and the corresponding Type starts with (prefix) RefDataNamespace..

Values: "string" "int" "Guid"
refDataList boolean

This is required to enable a list of Reference Data values (as per RefDataType) to be passed as an argument for example.

validator string
validatorCode string
validationFramework string

Defaults to Operation.ValidationFramework.

Values: "CoreEx" "FluentValidation"
isMandatory boolean
layerPassing string

Defaults to All. To further describe, All passes the parameter through all layeys, ToManagerSet only passes the parameter to the Manager layer and overrides the same named property within the corresponding value parameter, ToManagerCollSet only passes the parameter to the Manager layer and overrides the same named property within the corresponding value collection parameter. Where using the PrimaryKey option to automatically set Parameters, and the Operation.Type is Create or Update it will default to ToManagerSet.

Values: "All" "ToManagerSet" "ToManagerCollSet"
dataConverter string

A Converter is used to convert a data source value to/from a .NET Type where no standard data conversion can be applied. Where this value is suffixed by <T> or {T} this will automatically set Type.

webApiFrom string

Defaults to FromQuery; unless the parameter Type has also been defined as an Entity within the code-gen config file then it will default to FromEntityProperties. Specifies that the parameter will be declared with corresponding FromQueryAttribute, FromBodyAttribute or FromRouteAttribute for the Web API method. The FromEntityProperties will declare all properties of the Entity as query parameters.An AcceptsBody indicates that the value will be passed in the HTTP Request Body and be handled (JSON deserialized) as a CoreEx.AspNetCore.WebApis.WebWebApiParam (default behavior for a Create or Update operation type).

Values: "FromQuery" "FromBody" "FromRoute" "FromEntityProperties" "AcceptsBody"
webApiText string

By default the WbeApiText will be the Name reformatted as sentence casing. To have the text used as-is prefix with a + plus-sign character.

grpcType string
Const object

The Const object is used to define a .NET (C#) constant value for an Entity.

name string required
value string required

The code generation will ensure the value is delimited properly to output correctly formed (delimited) .NET (C#) code.

text string

By default the Text will be the Name reformatted as sentence casing. It will be formatted as: Represents a {text} constant value. To create a <see cref="XXX"/> within use moustache shorthand (e.g. {{Xxx}}). To have the text used as-is prefix with a + plus-sign character.