Represents the NuGet versions.
- Fixed: Upgraded
CoreExto include all related fixes and improvements; possible related updates that may be required are:- The Entity Framework (EF)
AddEfDb<T>previously registered theTas theIEfDB(shorthand forAddEfDb<IEfDb, T>); this has been corrected to register theTas theTonly. Therefore, the registering should be updated to be more explcit, or theIEfDbdependency references should use the explicitTwhere required. - The Cosmos DB configuration must now be on the container and not the database; any lazy-loading references of the container can be removed as these are now cached internally.
- The Entity Framework (EF)
- Enhancement: Added
net9.0support. - Enhancement: Deprecated
net7.0support; no longer supported by Microsoft. - Enhancement: Updated dependencies to latest; including transitive where applicable.
- Enhancement: Integrated
UnitTestExversion5.0.0to enable the latest capabilities and improvements.CoreEx.UnitTesting.NUnitgiven changes is no longer required and has been deprecated, theUnitTestEx.NUnit(or other) must be explicitly referenced as per testing framework being used.CoreEx.UnitTestingpackage updated to include only standard .NET core capabilities to follow newUnitTestExpattern; new packages created to house specific as follows:CoreEx.UnitTesting.Azure.Functionscreated to house Azure Functions specific capabilities;CoreEx.UnitTesting.Azure.ServiceBuscreated 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
UnitTestExnamespace. The updated default withinUnitTestExis to expose the key capabilities from the root namespace. For example,using UnitTestEx.NUnit, should be replaced withusing UnitTestEx.
- Fixed: The database console
Scriptcommand execution has been updated to output to the correct directory path. - Fixed: The
Agentcode-generation artefacts have been further simplified/improved. - Fixed: The database code-generation support for replacement is now optional (see new
Replaceproperty) versus always (defaults totrue).
- Enhancement: The
Common-project related code-generated artefacts have all been updated to leverageglobal usingand file scoped namespace declarations.- A new
GlobalUsings.cswill need to be manually added to existingCommonprojects to enable; see this for an example and alter the last two namespaces accordingly. - The
*.Common.csprojwill need to be manually updated to include<LangVersion>Preview</LangVersion>and<ImplicitUsings>true</ImplicitUsings>.
- A new
- Fixed:
Operation.AuthEntityandOperation.AuthOperationupdated to code-gen theManager-based authorization (ExecutionContent.UserIsAuthorized) invocation. - Fixed: Code-generation logging/auditing of endpoints updated to also include the authorization configuration.
- Fixed:
CreatePropertystatement 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
CollectionTypeproperty 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
UDTto 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
Typeschema objects (udtBigIntList.sql,udtDateTimeList.sql,udtIntList.sql,udtNVarCharList.sqlandudtUniqueIdentifierList.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.sqlmigration script to add. - Enhancement: All code-generated SQL objects have been updated to support replacement, for example
CREATE OR ALTERversus 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.EventValuewhere applicable (i.e. no response).
- Fixed: Added option
AcceptsBodytoParameter.WebApiFromto ensure consistent behaviour withCreateandUpdateoperation types in terms of how a body value is handled within the API Controller. - Fixed: Fixed the
valueparameter inference where operation type isCustomand theValueTypeis specified; ensures operation is generated correctly. - Fixed: Fixed the Agent code-generation to enable optional operation parameters where applicable.
- Enhancement: Added
Operation.Queryboolean to enable support for OData-like query syntax. This leverages the underlyingCoreEx.Data.Querying(v3.25.1+) capabilities to enable. TheOperation.Behaviorhas 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,ODataNameandHttpAgentNameto support bothType(existing) and optionalName(new). This uses theType^Namesyntax supported for other properties with similar purpose. The properties have also had theNamesuffix renamed toTypeas 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
PartitionKeywhere specified. - Fixed: Fixed the code-generated
PartitionKeyto be a nullable string. - Fixed: Fixed the templated
CosmosDbto ensure lazy-loading of container (versus re-creating on each access).
- Fixed: Fixed the manager code-generation to reference parameter
valueasv, and outputThenAsAsync, correctly. - Fixed: Fixed the manager code-generation to use the new
Result<T>.Adjuststo 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,DataSvcCtorCustomandDataCtorCustomto allow the constructor to be implemented as custom, non-generated, by the consuming developer.
- Enhancement:
Operation.DataSvcCustomchanged from boolean to an option that indicates the level ofDataSvccustomization (invokes*OnImplementationAsyncmethod) vs code-generation (automatically invokes data-layer).- Valid values are:
Fullindicates the logic is fully customized (only invocation is code-generated).Partialindicates combination of surrounding code-generation with final custom invocation versus data-layer.Noneindicates data-layer invocation with no custom invocation (default).
- Existing configurations of
dataSvcCustom: trueshould be changed todataSvcCustom: Fullto achieve same behavior. Where not changed a code-generation runtime error will occur.
- Valid values are:
- Enhancement: Added support for
Property-basedICacheKeysupport usingcacheKey: trueresulting 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
PrimaryKeywhere 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 openapioption to perform basic parsing of an OpenAPI document generating the correspondingEntity,OperationandPropertyconfiguration 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 -- --helpto see all command-line capabilities for this. - All OpenAPI paths (operations) are generated into a single
Serviceentity; 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
OpenApiArgssupports further options to enable additional customization of processing and generated output; this is set using theCodeGenConsole.WithOpenApiArgsmethod. - 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.ControllerandCommonsummary text comments to remove internal references, etc.
- Fixed: Enable
textspecification 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
ModelInheritsto be specified within theEntityYAML configuration to override the default. - Fixed: Fixed
dotnet run countto exclude paths that start with.(dot) to avoid including hidden files in the count.
- Fixed: Fixes the model code-generation to auto implement the
ITenantIdandILogicallyDeletedwhere corresponding properties are defined. - Fixed: Fixed the manager code-generation to output the
IdentifierGeneratorcode where inheriting theIdproperty.
- Fixed: The EF Model generation has had the
ITenantId.TenantIdfiltering removed as out-of-the-box EF caches first and uses resulting in an unexpected side-effect. TheCoreEx.EntityFrameworkas ofv3.20.0automatically 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 theOperationIdwithin the OpenAPI output. - Issue 244: Fixed
Operation.HttpAgentRoutewhere specified as a query string?foo=bar; was being generated asprefix/?foo=barversusprefix?foo=bar. - Fixed: Upgraded
CoreEx(v3.18.1) to include all related fixes and improvements.
- Fixed: Fixes to the
Templatesolution to improve the initialdotnet new beefexperience, including sample Reference Data API tests. - Fixed: Upgraded
CoreEx(v3.18.0) to include all related fixes and improvements. - Fixed: The
EntityManager_cs.hbstemplate has been updated to account for theCoreEx.Validation.ValueValidator<T>fixes.
- Fixed: Fixes to the
Templatesolution to improve the initialdotnet new beefexperience with respect to API health endpoint.
- Fixed: Fixes to the
Templatesolution to improve the initialdotnet new beefexperience.
- 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
TypedHttpClientBaseconstructor signature inCoreEx(v3.15.0).
- Enhancement: Added
WebApiTagscode-generation property to enable the specification ofTagsfor the Web API Controller class. - Enhancement: Added
dotnet run endpointsoption 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.yamlcan 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.yamlfiles respectively. The secondary files only support a single rootentitiesproperty/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.ReturnTypewas incorrectly determining and overridding nullability (Operation.ReturnTypeNullability) which has been corrected.
- Enhancement: Added
dotnet new beef ... --services AzFunctionto enable the templating of a correspondingCompany.AppName.Servicesproject as an Azure Functions project. This will provide an example of leveraging the sharedCompany.AppName.Businesslogic 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: falsein theentity.beef-5.yamlfile (root and/or entity within hierarchy).
- Enhancement: Added PostgreSQL database support:
- Leverages both
CoreEx.Database.Postgres(runtime) andDbEx.Postgres(migration) packages; encapsulates theNpgsqlpackage. - The
Npgsql.EntityFrameworkCore.PostgreSQLpackage is used for the entity framework provider. - The
dotnet new beeftemplate updated to support newdatasourceoption ofpostgres.
- Leverages both
- Enhancement: Additional improvements for data migration and code-generation, including
SqlServerandMySql, as a result ofDbEx(v2.5.0) enhancements.
- Fixed: Simplified YAML specification where only a custom manager is required to be implemented. For an
operationsettype: 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 beeftemplate to targetnet8.0and updatedNUnit.- Note:
MySQLincludes 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;WebApiclass supports returning value ofIActionResultas-is. - Enhancement: Updated code-generation to support
IActionResultreturn type forWebApioperations. The followingoperationYAML properties enable:- New
webApiProduces: [ 'text/plain' ]where the value is aProducescontent type array (supports multiple) to override the default; for example[Produces("text/plain")]. - New
webApiProducesResponseType: noneindicates 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
cleancode-generation command supports new path exclusion capabilities; seedotnet run -- --helpfor details. - Fixed: The
countcode-generation command has been added to report the total number of files and lines for all and generated code.
- Fixed: The
Entity.HttpAgentCustomMapperproperty 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:
UnitTestExas ofv4.0.0removed all dependencies toCoreEx; the equivalent functionality has been included in newCoreEx.UnitTestandCoreEx.UnitTest.NUnit(v3.6.0) packages. Replace existingUnitTestEx.NUnitpackage with the correspondingCoreEx.UnitTesting.NUnitpackage.- Unfortunately, this change has resulted in a number of breaking changes that will require manual remediation to existing unit tests; see the
UnitTestExchange log andCoreExchange 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.0andnet8.0support.
- Fixed: The
yamlsub-command generated code updated to leverage the newEntity.Behavior, beingbehavior: cgupd, where CRUD capabilities are requested.
- Fixed:
Entity.Cruddeprecated and replaced with newEntity.Behaviorto 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: truewas previously specified, this should be replaced withbehavior: cgupd(note that code-generation will error where not updated). - Fixed:
Entity.WebApiRoutePrefixno longer applied to theControllerclass using theRouteattribute; now always included as the full path specified within the HTTP method attribute per operation. TheOperation.WebApiRoutecan now be prefixed with a!character to indicate that theEntity.WebApiRoutePrefixshould not be applied; i.e. the supplied value is leveraged as-is. This enables more scenarios for theEntity.Behaviorabove to be used, as often it was the route value that necessitated full operation specification within YAML. - Fixed: Related
httpAgentRouteconfiguration 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; updateDataSvctemplate 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.Typeentity code-generation attribute explicitly defaults toCustomwhere not specified. - Fixed: Reference data entity code-generation adds
NotNullIfNotNullAtrributeto correct null compiler warnings. TheSystem.Diagnostics.CodeAnalysisnamespace may need to be added to theGlobalUsingsto enable. - Fixed: Improved the default
Parameter.Textand enabledParameter.WebApiTextto override explicity where required.
- Fixed: Entity was not correctly generated where default value was specified to ensure correct
IsInitiallogic. - Fixed: Entity was not correctly generated where
RefDataListwas specified; code-gen output improved.
- Fixed: Enhanced the default
Entity.RefDataTypebehaviour; will default to rootCodeGeneration.RefDataType(new), where specified to simplify configuration. - Fixed: Enhanced the default
Entity.Collectionbehaviour; will default totrue,whereRefDataTypeis specified as this is required. - Fixed: Enhanced the default
Entity.AutoImplementbehaviour; will default to rootCodeGeneration.AutoImplement(new), where specified to simplify configuration. - Fixed: Enhanced the default
Entity.WebApiRoutePrefixbehaviour; will default toEntity.Namepluralized and lowercase, whereRefDataTypeis specified as this is required.
- Fixed: Enhanced the default
Entity.TextandProperty.Textcode-generation attributes where not specified to be more meaningful/descriptive.
- Fixed: Added new
Entity.Crudcode-generation attribute which represents a shorthand forCreate,Get(read),Update(includesPatch) andDelete.
- Fixed: The previous
excludeData: RequiresMapperfix 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 ayamlsub-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.yamlfile. 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.yamlfile 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 -- --helpto see all command-line options/capabilities for this. - Fixed: The
excludeData: RequiresMapperno longer needs to be explicitly set as this is now inferred from the usage of anautoImplementfor theentityYAML configuration.
- Fixed: Updated
DbEx(v2.3.8) andOnRamp(v1.0.8). - Fixed: Updated
UnitTestEx(3.1.0):- The
ApiTester.SetUp.ExpectedEventsEnabled = trueshould 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
CoreExtov3.3.0to 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
CoreExtov3.0.0which resulted in a number of breaking changed that will require manual remediation:- The
CoreEx.WebApiscapabilities have been moved to the newCoreEx.AspNetCore.WebApisnamespace; 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
ResultandResult<T>railway-oriented programming capabilities introduced inv3to 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
v3changes/fixes and general improvements; as such all code-generation should be re-run. Note that by default the generated code will leverageResultandResult<T>; for backwards compatibility setwithResult: falsewithin theentity.beef-5.yaml. - Also, note that
v3may introduce some breaking changes that will need manual remediation. The validationOnValidateAsyncandCustomRulemust 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 correspondingwebApiAuthorizeYAML 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
preprocessorDirectivesYAML configuration. This relates to the existing#nullable enableand#pragma warning disablepreprocessor directives. These will be deprecated in a future release.
- Fixed: Upgraded
CoreExandUnitTestExto latest packages to include all related fixes.
- Enhancement: Added new code-generation configuration property
ValidationFrameworkthat supports eitherCoreEx(default) orFluentValidation(uses theCoreEx.FluentValidationinterop wrapping capabilities) to allow entity validation to be performed using either framework. Supports mix-and-matching where required. TheCoreEx.Validationframework is still leveraged forIsMandatoryandValidatorCodelogic where specified. - Issue 208:
ReferenceDataController.GetNamednow excluded from Swagger output as results in superfluous types/models. - Issue 209: New
PagingAttributeadded to theControllercode-gen wherePagingArgsis selected to outputPagingArgsparameters to corresponding Swagger output. RequiresPagingOperationFilterto be added at start up to function. - Fixed: Upgraded
CoreEx,DbExandUnitTestExto latest packages to include all related fixes.
- Fixed: Upgraded
DbExtov2.3.4; this included fix to assembly management/probing that required minor internal change to enable correctly withinSqlServerMigrationandMySqlMigration.
- Enhancement: The Manager-layer
Clean.CleanUpis 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.MapperwithinCoreEx v2.6.0resolved 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.WarnWhereDeprecatedwas checking some incorrectly cased property names. - Fixed: The
AgentTester<TEntryPoint>has been updated to allow a parameterlessCreateWaf, as well as exposing the internalParentproperty.
- Fixed: Upgraded
CoreEx,DbExandUnitTestExto 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.