beef-database-v5-codegen
Beef (Business Entity Execution Framework) database code-generation configuration (v5)
| File match |
database.beef-5.yaml
database.beef-5.yml
database.beef-5.json
*.database.beef-5.yaml
*.database.beef-5.yml
*.database.beef-5.json
|
|---|---|
| Schema URL | https://catalog.lintel.tools/schemas/schemastore/beef-database-v5-codegen/latest.json |
| Source | https://raw.githubusercontent.com/Avanade/Beef/master/tools/Beef.CodeGen.Core/Schema/database.beef-5.json |
Validate with Lintel
npx @lintel/lintel check
All of
Definitions
The CodeGeneration object defines global properties that are used to drive the underlying database-driven code generation.
This is used as the default Schema for all child objects.
Defaults to true.
Defaults to IsDeleted.
Defaults to TenantId.
Defaults to OrgUnitId.
Defaults to RowVersion.
Defaults to CreatedBy.
Defaults to CreatedDate.
Defaults to UpdatedBy.
Defaults to UpdatedDate.
Defaults to UpdatedBy.
Defaults to UpdatedDate.
Defaults to [Sec].[fnGetUserOrgUnits]().
Defaults to [Sec].[spCheckUserHasPermission].
Defaults to [Sec].[fnGetUserHasPermission].
Each alias value should be formatted as Column + ^ + Alias; e.g. PCODE^ProductCode.
Defaults SnakeKebabToPascalCase that will remove any underscores or hyphens separating each word and capitalize the first character of each; e.g. internal-customer_id would be renamed as InternalCustomerId. The PascalCase option will capatilize the first character only.
Values are JSON being a JSON array (preferred) or UDT for a User-Defined Type (legacy). Defaults to JSON.
This can be overridden within the Table(s).
Defaults to false.
Defaults to Outbox (literal).
Defaults to true.
Defaults to EventOutbox (literal).
Defaults to spEventOutboxEnqueue (literal).
Defaults to spEventOutboxDequeue (literal).
Defaults to Company (runtime parameter) + . + AppName (runtime parameter). For example Beef.Demo.
Defaults to PathBase + .Database/Schema (literal). For example Beef.Demo.Database/Schema.
Defaults to PathBase + .Database/Migrations (literal). For example Beef.Demo.Database/Migrations.
Defaults to PathBase + .Business (literal). For example Beef.Demo.Business.
This is only applicable for stored procedures.
Defaults to Company (runtime parameter) + . + AppName (runtime parameter). For example Beef.Demo.
Defaults to NamespaceBase + .Common (literal). For example Beef.Demo.Common.
Defaults to NamespaceBase + .Business (literal). For example Beef.Demo.Business.
Defaults to NamespaceBusiness.
The Table object identifies an existing database Table (or View) and defines its code-generation characteristics.
Defaults to CodeGeneration.Schema.
Will automatically default where not specified.
Defaults to CodeGeneration.Replace.
Where not specified this indicates that all Columns are to be included.
Where not specified this indicates no Columns are to be excluded.
Each alias value should be formatted as Column + ^ + Alias; e.g. PCODE^ProductCode.
Each alias value should be formatted as Column + ^ + Alias; e.g. ProductCode^product.
The GetAllOrderBy is used to specify the GetAll query sort order.
This relates to the GetAll selection.
This will also require a Udt (SQL User Defined Table) and Tvp (.NET Table-Valued Parameter) to function.
Defaults to CodeGeneration.EfModel.
Defaults to Name applying the CodeGeneration.AutoDotNetRename.
Where not specified this indicates that no Columns are to be excluded.
Values are JSON being a JSON array (preferred) or UDT for a User-Defined Type (legacy). Defaults to Config.CollectionType.
Defaults to CodeGeneration.OrgUnitImmutable. This is only applicable for stored procedures.
Defaults to CodeGeneration.IsDeleted.
Defaults to CodeGeneration.TenantId.
Defaults to CodeGeneration.OrgUnitId.
Defaults to CodeGeneration.RowVersion.
Defaults to CodeGeneration.CreatedBy.
Defaults to CodeGeneration.CreatedDate.
Defaults to CodeGeneration.UpdatedBy.
Defaults to CodeGeneration.UpdatedDate.
Defaults to CodeGeneration.UpdatedBy.
Defaults to CodeGeneration.UpdatedDate.
The code generation for an StoredProcedure 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 Upsert, Merge and ad-hoc queries as required.
See StoredProcedureName for the actual name used in the database.
Defaults to GetColl.
This only applies where the stored procedure operation Type is GetColl.
Defaults to sp + Table.Name + Name; e.g. spTableName or spPersonGet.
Defaults to CodeGeneration.Replace.
Defaults to [{{Table.Schema}}].[sp{{Table.Name}}Get] passing the primary key column(s).
A Select * from #TempTable is also performed (code-generated) where the stored procedure operation Type is GetColl.
Values are JSON being a JSON array (preferred) or UDT for a User-Defined Type (legacy). Defaults to Table.CollectionType.
This is used to override the default behaviour of using the primary key column(s).
Defaults to Table.OrgUnitImmutable.
Where not specified this indicates that all Columns are to be included. Only filters the columns where Type is Get, GetColl, Create, Update or Upsert.
Where not specified this indicates no Columns are to be excluded. Only filters the columns where Type is Get, GetColl, Create, Update or Upsert.
The Parameter is used to define a stored procedure parameter and its charateristics. These are in addition to those that are automatically inferred (added) by the selected StoredProcedure.Type.
Defaults to Name.
Note that when the parameter value is NULL it will not be included in the query.
Values are JSON being a JSON array (preferred) or UDT for a User-Defined Type (legacy). Defaults to StoredProcedure.CollectionType.
Defaults to EQ.
The Where object defines an additional where Statement to be added. This is in addition to those automatically added based on the StoredProcedure.Type.
The OrderBy object defines the query order. Only valid for StoredProcedure.Type of GetAll.
Defaults to Ascending.
The Execute object enables additional TSQL statements to be embedded within the stored procedure.
Defaults to After.
The Relationship object enables the definition of an entity framework (EF) model relationship.
Defaults to CodeGeneration.Schema.
Defaults to OneToMany.
Typically this is only used where referencing property(s) other than the primary key as the principal property(s).
Defaults to NoAction. See https://learn.microsoft.com/en-us/dotnet/api/microsoft.entityframeworkcore.deletebehavior for more information.
Defaults to false.
Defaults to Name using the CodeGeneration.AutoDotNetRename option.
Defaults to Name using the CodeGeneration.AutoDotNetRename option.
The Query object enables the definition of more complex multi-table queries (Joins) that would primarily result in a database View. The primary table Name for the query is required to be specified. Multiple queries can be specified for the same table(s). The IncludeColumns and ExcludeColumns provide a shorthand to include or exclude selected columns; with the AliasColumns providing a means to rename where required (for example duplicate name). Additional Where and Order configuration can also be added as required.
Defaults to CodeGeneration.Schema.
Will automatically default where not specified.
Where not specified this indicates that all Columns are to be included.
Where not specified this indicates no Columns are to be excluded.
Each alias value should be formatted as Column + ^ + Alias; e.g. PCODE^ProductCode
Defaults to vw + Name; e.g. vwTableName.
Defaults to Schema.
Defaults to CodeGeneration.Replace.
The suffix is optional, and where not specified will default to .READ.
Defaults to CodeGeneration.IsDeleted.
Defaults to CodeGeneration.TenantId.
Defaults to CodeGeneration.OrgUnitId.
Defaults to CodeGeneration.RowVersion.
Defaults to CodeGeneration.CreatedBy.
Defaults to CodeGeneration.CreatedDate.
Defaults to CodeGeneration.UpdatedBy.
Defaults to CodeGeneration.UpdatedDate.
Defaults to CodeGeneration.UpdatedBy.
Defaults to CodeGeneration.UpdatedDate.
The QueryJoin object defines a join to another (or same) table within a query. The Type defines the join type, such as inner join, etc. The IncludeColumns and ExcludeColumns provide a shorthand to include or exclude selected columns; with the AliasColumns providing a means to rename where required (for example duplicate name).
Defaults to Table.Schema; i.e. same schema.
Will automatically default where not specified.
Defaults to Inner.
Where not specified this indicates that all Columns are to be included.
Where not specified this indicates no Columns are to be excluded.
Each alias value should be formatted as Column + ^ + Alias; e.g. PCODE^ProductCode
Defaults to CodeGeneration.IsDeleted.
Defaults to CodeGeneration.TenantId.
Defaults to CodeGeneration.OrgUnitId.
Defaults to CodeGeneration.RowVersion.
Defaults to CodeGeneration.CreatedBy.
Defaults to CodeGeneration.CreatedDate.
Defaults to CodeGeneration.UpdatedBy.
Defaults to CodeGeneration.UpdatedDate.
Defaults to CodeGeneration.UpdatedBy.
Defaults to CodeGeneration.UpdatedDate.
The QueryJoinOn object defines the join on characteristics for a join within a query.
Defaults to Table.Schema; i.e. same schema. See also ToTable and ToColumn as these all relate.
Defaults to Table.Name; i.e. primary table. See also ToSchema and ToColumn as these all relate.
Defaults to Name; i.e. assumes same name. See also ToSchema and ToTable as these all relate.
The QueryOrder object that defines the query order.
See also Schema and Table as these all relate.
Defaults to Query.Schema.
Defaults to Table.Name; i.e. primary table. See also Schema and Column as these all relate.
Defaults to Ascending.
The QueryWhere object defines an additional where Statement to be added.