Represents the NuGet versions.
- Enhancement: Added
net9.0
support. - Enhancement: Deprecated
net7.0
support; no longer supported by Microsoft. - Enhancement: Updated dependencies to latest; including transitive where applicable.
- Enhancement: Integrated
UnitTestEx
version5.0.0
to enable the latest capabilities and improvements.CoreEx.UnitTesting.NUnit
given changes is no longer required and has been deprecated, theUnitTestEx.NUnit
(or other) must be explicitly referenced as per testing framework being used.CoreEx.UnitTesting
package updated to include only standard .NET core capabilities to follow newUnitTestEx
pattern; new packages created to house specific as follows:CoreEx.UnitTesting.Azure.Functions
created to house Azure Functions specific capabilities;CoreEx.UnitTesting.Azure.ServiceBus
created to house Azure Service Bus specific capabilities.
- Existing usage will require references to the new packages as required. There should be limited need to update existing tests to use beyond the requirement for the root
UnitTestEx
namespace. The updated default withinUnitTestEx
is to expose the key capabilities from the root namespace. For example,using UnitTestEx.NUnit
, should be replaced withusing UnitTestEx
.
- Fixed: The database console
Script
command execution has been updated to output to the correct directory path. - Fixed: The
Agent
code-generation artefacts have been further simplified/improved. - Fixed: The database code-generation support for replacement is now optional (see new
Replace
property) versus always (defaults totrue
).
- Enhancement: The
Common
-project related code-generated artefacts have all been updated to leverageglobal using
and file scoped namespace declarations.- A new
GlobalUsings.cs
will need to be manually added to existingCommon
projects to enable; see this for an example and alter the last two namespaces accordingly. - The
*.Common.csproj
will need to be manually updated to include<LangVersion>Preview</LangVersion>
and<ImplicitUsings>true</ImplicitUsings>
.
- A new
- Fixed:
Operation.AuthEntity
andOperation.AuthOperation
updated to code-gen theManager
-based authorization (ExecutionContent.UserIsAuthorized
) invocation. - Fixed: Code-generation logging/auditing of endpoints updated to also include the authorization configuration.
- Fixed:
CreateProperty
statement within generated entity updated to use the correct name for reference data properties.
- Fixed: Upgraded dependencies related to
System.Text.Json
; resolve Microsoft Security Advisory CVE-2024-43485.
- Enhancement: Database code-generation defaults to the use of JSON-serialized parameters versus UDT/TVP to minimize the need for additional database objects; specifically User-Defined Types (UDT).
- A new
CollectionType
property has been added to the code-generation configuration for query-based collection passing; supportsJSON
(default) andUDT
(previous) values. Note that for JSON passing aNVARCHAR(MAX)
type should be used. - A merge for a sub-collection would previously require a
UDT
to be created; this is now handled using JSON serialization, unless explicitly required (example YAMLudt: true, tvp: WorkHistory
).
- A new
- Enhancement: The out-of-the-box Beef
Type
schema objects (udtBigIntList.sql
,udtDateTimeList.sql
,udtIntList.sql
,udtNVarCharList.sql
andudtUniqueIdentifierList.sql
) have been removed and will not be automatically included. Where required, these should be manually added to the database project and managed accordingly; use thiscreate-beef-user-defined-types.sql
migration script to add. - Enhancement: All code-generated SQL objects have been updated to support replacement, for example
CREATE OR ALTER
versus previousCREATE
; this potentially minimizes the need to drop and recreate each migration. This DbEx behavior is predicated on not having anyType
(UDT) schema objects which do not support replacement. It is also therefore recommended that all non-generated schema objects support replacement as they all have to adhere to this pattern to avoid unncessary dropping.
- Fixed: Fixed the event value publish code-generation by enabling an override using
Operation.EventValue
where applicable (i.e. no response).
- Fixed: Added option
AcceptsBody
toParameter.WebApiFrom
to ensure consistent behaviour withCreate
andUpdate
operation types in terms of how a body value is handled within the API Controller. - Fixed: Fixed the
value
parameter inference where operation type isCustom
and theValueType
is specified; ensures operation is generated correctly. - Fixed: Fixed the Agent code-generation to enable optional operation parameters where applicable.
- Enhancement: Added
Operation.Query
boolean to enable support for OData-like query syntax. This leverages the underlyingCoreEx.Data.Querying
(v3.25.1+
) capabilities to enable. TheOperation.Behavior
has also been extended to support a 'Q
'uery as a shorthand to enable a query-based operation. Note: this is an awesome new capability. - Enhancement: Updated the
DatabaseName
,EntityFrameworkName
,CosmosName
,ODataName
andHttpAgentName
to support bothType
(existing) and optionalName
(new). This uses theType^Name
syntax supported for other properties with similar purpose. The properties have also had theName
suffix renamed toType
as this more accurately reflects the property intent (existing names will continue to work with a corresponding warning during code-generation).
- Fixed: Fixed the data model code-generation to output the
PartitionKey
where specified. - Fixed: Fixed the code-generated
PartitionKey
to be a nullable string. - Fixed: Fixed the templated
CosmosDb
to ensure lazy-loading of container (versus re-creating on each access).
- Fixed: Fixed the manager code-generation to reference parameter
value
asv
, and outputThenAsAsync
, correctly. - Fixed: Fixed the manager code-generation to use the new
Result<T>.Adjusts
to avoid unintended compiler identified casting when usingThen
. - Fixed: Fixed the manager, data service and data code-generation to not output a constructor where there are no constructor parameters; i.e. is not required.
- Fixed: Added
ManagerCtorCustom
,DataSvcCtorCustom
andDataCtorCustom
to allow the constructor to be implemented as custom, non-generated, by the consuming developer.
- Enhancement:
Operation.DataSvcCustom
changed from boolean to an option that indicates the level ofDataSvc
customization (invokes*OnImplementationAsync
method) vs code-generation (automatically invokes data-layer).- Valid values are:
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).
- Existing configurations of
dataSvcCustom: true
should be changed todataSvcCustom: Full
to achieve same behavior. Where not changed a code-generation runtime error will occur.
- Valid values are:
- Enhancement: Added support for
Property
-basedICacheKey
support usingcacheKey: true
resulting in corresponding entity code-generation. - Fixed: Model code-generation corrected to explicitly output
Newtonsoft.Json.JsonIgnore
. - Fixed: Entity and model templates updated to correctly generate the
PrimaryKey
where the property is reference data. - Fixed: Entity collection code-generation for Dictionary updated to include capabilities to add items using primary key where specified.
- Fixed: Upgraded dependencies.
- Enhancement: Added
dotnet run openapi
option to perform basic parsing of an OpenAPI document generating the correspondingEntity
,Operation
andProperty
configuration into a temporary YAML file. The contents are expected to then be copied and pasted into the appropriate YAML destination and further configured as necessary.- Execute
dotnet run -- --help
to see all command-line capabilities for this. - All OpenAPI paths (operations) are generated into a single
Service
entity; this can be further split into multiple entities manually as required. - Where a schema (entity) is specified more than once with the same name it will attempt to match the configuration (including properties) to an existing entity and reuse; otherwise, a new entity will be created with a postfix number to ensure uniqueness.
- The
OpenApiArgs
supports further options to enable additional customization of processing and generated output; this is set using theCodeGenConsole.WithOpenApiArgs
method. - Note: this is in preview until explicitly noted in a later version; as such, the generated YAML will require manual review and adjustment as required and may not support all features (for some time or ever). This is only intended to help accelerate the initial configuration process where an OpenAPI document is available.
- Execute
- Fixed: Sanitize the generated
Api.Controller
andCommon
summary text comments to remove internal references, etc.
- Fixed: Enable
text
specification to be used as-is by prefixing with a+
plus-sign character. - Fixed: Upgraded
DbEx
(v2.5.8
) to include all related fixes and improvements.
- Fixed: Fixed the model code-generation by allowing the
ModelInherits
to be specified within theEntity
YAML configuration to override the default. - Fixed: Fixed
dotnet run count
to exclude paths that start with.
(dot) to avoid including hidden files in the count.
- Fixed: Fixes the model code-generation to auto implement the
ITenantId
andILogicallyDeleted
where corresponding properties are defined. - Fixed: Fixed the manager code-generation to output the
IdentifierGenerator
code where inheriting theId
property.
- Fixed: The EF Model generation has had the
ITenantId.TenantId
filtering removed as out-of-the-box EF caches first and uses resulting in an unexpected side-effect. TheCoreEx.EntityFramework
as ofv3.20.0
automatically includes tenant filtering to achieve the desired behavior. - Fixed: Upgraded
CoreEx
(v3.20.0
) to include all related fixes and improvements.
- Issue 243: Fixed
[HttpGet("persons/{id}")]
to[HttpGet("persons/{id}, Name=Entity-Name_Operation-Name)")]
which sets theOperationId
within the OpenAPI output. - Issue 244: Fixed
Operation.HttpAgentRoute
where specified as a query string?foo=bar
; was being generated asprefix/?foo=bar
versusprefix?foo=bar
. - Fixed: Upgraded
CoreEx
(v3.18.1
) to include all related fixes and improvements.
- Fixed: Fixes to the
Template
solution to improve the initialdotnet new beef
experience, including sample Reference Data API tests. - Fixed: Upgraded
CoreEx
(v3.18.0
) to include all related fixes and improvements. - Fixed: The
EntityManager_cs.hbs
template has been updated to account for theCoreEx.Validation.ValueValidator<T>
fixes.
- Fixed: Fixes to the
Template
solution to improve the initialdotnet new beef
experience with respect to API health endpoint.
- Fixed: Fixes to the
Template
solution to improve the initialdotnet new beef
experience.
- Fixed: Upgraded
CoreEx
(v3.15.0
) to include all related fixes and improvements. - Fixed: The API Agent templates have been updated to account for the changes to the
TypedHttpClientBase
constructor signature inCoreEx
(v3.15.0
).
- Enhancement: Added
WebApiTags
code-generation property to enable the specification ofTags
for the Web API Controller class. - Enhancement: Added
dotnet run endpoints
option to report all configured endpoints providing a means to audit the generated API surface. - Enhancement: Secondary (additional) configuration files
*.entity.beef-5.yaml
,*.refdata.beef-5.yaml
,*.datamodel.beef-5.yaml
can be added to the project (including within subfolders) that will be automatically merged into the corresponding primaryentity.beef-5.yaml
,refdata.beef-5.yaml
,datamodel.beef-5.yaml
files respectively. The secondary files only support a single rootentities
property/node that merges into the primary's equivalent. This allows the configuration to be broken up logically to minimize challenges related to overall file size and complexity, and minimize potential developer merge conflicts, etc. - Fixed: The
Operation.ReturnType
was incorrectly determining and overridding nullability (Operation.ReturnTypeNullability
) which has been corrected.
- Enhancement: Added
dotnet new beef ... --services AzFunction
to enable the templating of a correspondingCompany.AppName.Services
project as an Azure Functions project. This will provide an example of leveraging the sharedCompany.AppName.Business
logic and consuming the published events using anEventSubscriberOrchestrator
. - Enhancement: The
DatabaseMapper
(stored procedures) code-generation logic has been updated to leverage the new extendedDatabaseMapperEx
. This avoids the existing reflection and expression compilation, using explicit code to perform the mapping. Can offer up to 40%+ improvement in some scenarios. Where existing behavior is required then set YAMLdatabaseMapperEx: false
in theentity.beef-5.yaml
file (root and/or entity within hierarchy).
- Enhancement: Added PostgreSQL database support:
- Leverages both
CoreEx.Database.Postgres
(runtime) andDbEx.Postgres
(migration) packages; encapsulates theNpgsql
package. - The
Npgsql.EntityFrameworkCore.PostgreSQL
package is used for the entity framework provider. - The
dotnet new beef
template updated to support newdatasource
option ofpostgres
.
- Leverages both
- Enhancement: Additional improvements for data migration and code-generation, including
SqlServer
andMySql
, as a result ofDbEx
(v2.5.0
) enhancements.
- Fixed: Simplified YAML specification where only a custom manager is required to be implemented. For an
operation
settype: CustomManagerOnly
, this is a shorthand fortype: Custom, managerCustom: true, excludeIDataSvc: true, excludeDataSvc: true, excludeIData: true, excludeData: true
(i.e. these other properties will no longer need to be set explicitly).
- Fixed: Upgraded
CoreEx
(v3.9.0
) andDbEx
(v2.4.0
) to include all related fixes and improvements; including dependentUnitTestEx
(v4.0.1
) and relatedNUnit
(v4.0.1
) upgrades. - Enhancement: Updated the
dotnet new beef
template to targetnet8.0
and updatedNUnit
.- Note:
MySQL
includes dependencyPomelo.EntityFrameworkCore.MySql
(8.0.0-beta.2
) that enablesnet8.0
; this will be updated to the official release version when ready.
- Note:
- Fixed: Upgraded
CoreEx
(v3.8.0
) to include all related fixes and improvements;WebApi
class supports returning value ofIActionResult
as-is. - Enhancement: Updated code-generation to support
IActionResult
return type forWebApi
operations. The followingoperation
YAML properties enable:- New
webApiProduces: [ 'text/plain' ]
where the value is aProduces
content type array (supports multiple) to override the default; for example[Produces("text/plain")]
. - New
webApiProducesResponseType: none
indicates that the resulting generated code does not include the response type; for example[ProducesResponseType((int)HttpStatusCode.OK)]
.
- New
- Fixed: Upgraded
CoreEx
(v3.7.2
) to include all related fixes and improvements; updated reference data code-generation template and samples as a result.
- Fixed: The
clean
code-generation command supports new path exclusion capabilities; seedotnet run -- --help
for details. - Fixed: The
count
code-generation command has been added to report the total number of files and lines for all and generated code.
- Fixed: The
Entity.HttpAgentCustomMapper
property has been added to the schema to correctly include within code-generation. - Fixed: Upgraded
CoreEx
(v3.7.0
) to include all related fixes and improvements.
- Fixed: All related package dependencies updated to latest.
- Enhancement:
UnitTestEx
as ofv4.0.0
removed all dependencies toCoreEx
; the equivalent functionality has been included in newCoreEx.UnitTest
andCoreEx.UnitTest.NUnit
(v3.6.0
) packages. Replace existingUnitTestEx.NUnit
package with the correspondingCoreEx.UnitTesting.NUnit
package.- Unfortunately, this change has resulted in a number of breaking changes that will require manual remediation to existing unit tests; see the
UnitTestEx
change log andCoreEx
change log for details and instructions to remediate. - Upgraded
CoreEx
(v3.6.0
) to include all related fixes and improvements. - Upgraded
UnitTestEx
(v4.0.0
) to include all related fixes and improvements
- Unfortunately, this change has resulted in a number of breaking changes that will require manual remediation to existing unit tests; see the
- Enhancement: Added
net7.0
andnet8.0
support.
- Fixed: The
yaml
sub-command generated code updated to leverage the newEntity.Behavior
, beingbehavior: cgupd
, where CRUD capabilities are requested.
- Fixed:
Entity.Crud
deprecated and replaced with newEntity.Behavior
to enable improved flexibility in specifying which CRUD-style operation(s) are to be implemented: 'C'reate, 'G'et (or 'R'ead), 'U'pdate, 'P'atch and 'D'elete, GetByArgs ('B') and GetAll ('A'). Any combination (or order) can be provided to auto-generate versus specifiying individual properties (which can still be used if applicable). Wherecrud: true
was previously specified, this should be replaced withbehavior: cgupd
(note that code-generation will error where not updated). - Fixed:
Entity.WebApiRoutePrefix
no longer applied to theController
class using theRoute
attribute; now always included as the full path specified within the HTTP method attribute per operation. TheOperation.WebApiRoute
can now be prefixed with a!
character to indicate that theEntity.WebApiRoutePrefix
should not be applied; i.e. the supplied value is leveraged as-is. This enables more scenarios for theEntity.Behavior
above to be used, as often it was the route value that necessitated full operation specification within YAML. - Fixed: Related
httpAgentRoute
configuration and resulting code-generation implemented similar to above for consistency. - Fixed: Upgraded
CoreEx
(v3.4.1
) andDbEx
(v2.3.12
) to include all related fixes and improvements; updateDataSvc
template to leverage new (simplified)Result
-based caching capabilities.
- Fixed: Upgraded
CoreEx
(v3.4.0
) to include all related fixes and improvements; updated template and samples as a result.
- Fixed: The
Operation.Type
entity code-generation attribute explicitly defaults toCustom
where not specified. - Fixed: Reference data entity code-generation adds
NotNullIfNotNullAtrribute
to correct null compiler warnings. TheSystem.Diagnostics.CodeAnalysis
namespace may need to be added to theGlobalUsings
to enable. - Fixed: Improved the default
Parameter.Text
and enabledParameter.WebApiText
to override explicity where required.
- Fixed: Entity was not correctly generated where default value was specified to ensure correct
IsInitial
logic. - Fixed: Entity was not correctly generated where
RefDataList
was specified; code-gen output improved.
- Fixed: Enhanced the default
Entity.RefDataType
behaviour; will default to rootCodeGeneration.RefDataType
(new), where specified to simplify configuration. - Fixed: Enhanced the default
Entity.Collection
behaviour; will default totrue,
whereRefDataType
is specified as this is required. - Fixed: Enhanced the default
Entity.AutoImplement
behaviour; will default to rootCodeGeneration.AutoImplement
(new), where specified to simplify configuration. - Fixed: Enhanced the default
Entity.WebApiRoutePrefix
behaviour; will default toEntity.Name
pluralized and lowercase, whereRefDataType
is specified as this is required.
- Fixed: Enhanced the default
Entity.Text
andProperty.Text
code-generation attributes where not specified to be more meaningful/descriptive.
- Fixed: Added new
Entity.Crud
code-generation attribute which represents a shorthand forCreate
,Get
(read),Update
(includesPatch
) andDelete
.
- Fixed: The previous
excludeData: RequiresMapper
fix inadventently resulted in errant mapper code for the reference data code-generation which has been corrected.
- Enhancement: The database code-generation (
Beef.Database.*
) now supports ayaml
sub-command that will generate the basic Beef Entity YAML, and basic validation logic, by inferring the database configuration for the specified tables into a temporarytemp.entity.beef-5.yaml
file. The developer is then responsible for the copy and paste of the required yaml and .NET code, into their respective artefacts and further amending as appropriate. After use, the developer should remove thetemp.entity.beef-5.yaml
file as it is otherwise not referenced/used. This enhancement by no means endorses the direct mapping between entity and database model as the developer is still encouraged to reshape the entity to take advantage of object-orientation and resulting JSON capabilities. Beef still enforces a separation between entity and model even where a one-to-one match. Finally, usedotnet run -- --help
to see all command-line options/capabilities for this. - Fixed: The
excludeData: RequiresMapper
no longer needs to be explicitly set as this is now inferred from the usage of anautoImplement
for theentity
YAML configuration.
- Fixed: Updated
DbEx
(v2.3.8
) andOnRamp
(v1.0.8
). - Fixed: Updated
UnitTestEx
(3.1.0
):- The
ApiTester.SetUp.ExpectedEventsEnabled = true
should be replaced withApiTester.UseExpectedEvents()
where an event error occurs during test execution. - Value-based test expectations are updated to support explicit JSON paths, as a result some new errors may be reported (previously ignored in error) - note that JSON paths for arrays should not include the index.
- The
- Fixed: Upgraded
CoreEx
tov3.3.0
to include all related fixes and improvements related to distributed tracing. - Fixed: Code-generation templates updated to support any breaking changes related to
InvokerBase
.
- Enhancement: Upgraded
CoreEx
tov3.0.0
which resulted in a number of breaking changed that will require manual remediation:- The
CoreEx.WebApis
capabilities have been moved to the newCoreEx.AspNetCore.WebApis
namespace; within a new seperate project/packageCoreEx.AspNetCore
. This package will need to be referenced where required, and the namespace updated accordingly.
- The
- Enhancement: Leverages the new
Result
andResult<T>
railway-oriented programming capabilities introduced inv3
to minimize the number of thrown exceptions (of the non-exceptional variety), to improve performance and, the development and debugging experience.- A significant number of the underlying code-generation templates have been modified to support
v3
changes/fixes and general improvements; as such all code-generation should be re-run. Note that by default the generated code will leverageResult
andResult<T>
; for backwards compatibility setwithResult: false
within theentity.beef-5.yaml
. - Also, note that
v3
may introduce some breaking changes that will need manual remediation. The validationOnValidateAsync
andCustomRule
must now return aResult
. Where using, consider leveraging theResult.XxxError()
methods to return known errors versus throwing the related exception.
- A significant number of the underlying code-generation templates have been modified to support
- Enhancement: Code-generation API log output will state
<NoAuth>
explicitly where no authorization has been specified using the correspondingwebApiAuthorize
YAML configuration. - Enhancement: Where leveraging MySQL the template now uses the Pomelo.EntityFrameworkCore.MySql package; this has greater uptake and community supporting than the equivalent Oracle-enabled MySql.Data.EntityFrameworkCore package.
- Enhancement: The preprocessor directives are no longer generated by default for the C# artefacts, to re-include use the
preprocessorDirectives
YAML configuration. This relates to the existing#nullable enable
and#pragma warning disable
preprocessor directives. These will be deprecated in a future release.
- Fixed: Upgraded
CoreEx
andUnitTestEx
to latest packages to include all related fixes.
- Enhancement: Added new code-generation configuration property
ValidationFramework
that supports eitherCoreEx
(default) orFluentValidation
(uses theCoreEx.FluentValidation
interop wrapping capabilities) to allow entity validation to be performed using either framework. Supports mix-and-matching where required. TheCoreEx.Validation
framework is still leveraged forIsMandatory
andValidatorCode
logic where specified. - Issue 208:
ReferenceDataController.GetNamed
now excluded from Swagger output as results in superfluous types/models. - Issue 209: New
PagingAttribute
added to theController
code-gen wherePagingArgs
is selected to outputPagingArgs
parameters to corresponding Swagger output. RequiresPagingOperationFilter
to be added at start up to function. - Fixed: Upgraded
CoreEx
,DbEx
andUnitTestEx
to latest packages to include all related fixes.
- Fixed: Upgraded
DbEx
tov2.3.4
; this included fix to assembly management/probing that required minor internal change to enable correctly withinSqlServerMigration
andMySqlMigration
.
- Enhancement: The Manager-layer
Clean.CleanUp
is now only performed where explicitly configured; withinCodeGeneration
,Entity
(s) and/orOperation
(s) YAML. Cleaning is a feature that is generally infrequently used and is best excluded unless needed. - Enhancement: Code-generation console logging updated to output the generated endpoints to provide an audit of the generated API surface.
- Fixed: The
CoreEx.Mapping.Mapper
withinCoreEx v2.6.0
resolved initializing nullable destination properties during aFlatten
; however, this needed additional mapping configuration generated to enable. The generated mapping code was updated to enable, whilst also simplifing generated output, further enabling opportunities to override methods where required. - Fixed: Entity code generation output updated to assign correct property name (
INotifyPropertyChanged
) for all reference data properties.
- Fixed: The
CodeGenConfig.WarnWhereDeprecated
was checking some incorrectly cased property names. - Fixed: The
AgentTester<TEntryPoint>
has been updated to allow a parameterlessCreateWaf
, as well as exposing the internalParent
property.
- Fixed: Upgraded
CoreEx
,DbEx
andUnitTestEx
to latest packages to include all related fixes. Template solution updated to leverageapp.UseReferenceDataOrchestrator()
to specifically include.
- Represents the initial commit for Beef version 5.x. All assemblies/packages now share the same version and change log; i.e. they are now published as a set versus individually versioned (prior releases). This version is a major refactoring from the prior; to achieve largely the same outcomes, in a modernized decoupled manner.
- As stated in the README, Beef is now (as of version 5.x) ostensibly the code-generation engine, and solution orchestration, that ultimately takes dependencies on the following capabilities to enable the end-to-functionality and testing thereof in a standardized (albeit somewhat opinionated) manner:
- CoreEx - provides the core runtime capabilities (extends .NET core);
- UnitTestEx - provides extended unit and intra-domain integration testing;
- DbEx - provides extended database management capabilities ;
- OnRamp - provides the underlying code-generation engine functionality.
- Prior to version 5.x, Beef was all encompassing. These capabilities have been extracted, simplified and refactored to be first class frameworks in their own right, and made into the repos listed above. This allows them to be used and maintained independently to Beef; therefore, offering greater opportunities for reuse versus all-or-nothing.