From add6bd97ba36847e3278f6a02d731204f52118da Mon Sep 17 00:00:00 2001 From: "Eric Sibly [chullybun]" Date: Fri, 22 Dec 2023 11:51:27 -0800 Subject: [PATCH] Fix RefData GetNamed (#233) --- CHANGELOG.md | 3 + Common.targets | 2 +- .../Cdr.Banking.Api/Cdr.Banking.Api.csproj | 2 +- .../Generated/ReferenceDataController.cs | 4 +- .../Cdr.Banking.Business.csproj | 4 +- .../Agents/Generated/ReferenceDataAgent.cs | 57 ++------------- .../Cdr.Banking.Common.csproj | 2 +- .../Cdr.Banking.Test/Cdr.Banking.Test.csproj | 2 +- .../Demo/Beef.Demo.Api/Beef.Demo.Api.csproj | 2 +- .../Generated/ReferenceDataController.cs | 4 +- .../Beef.Demo.Business.csproj | 14 ++-- .../Agents/Generated/ReferenceDataAgent.cs | 73 +++---------------- .../Beef.Demo.Common/Beef.Demo.Common.csproj | 2 +- .../Demo/Beef.Demo.Test/Beef.Demo.Test.csproj | 2 +- .../Demo/Beef.Demo.Test/ReferenceDataTest.cs | 4 +- .../Generated/ReferenceDataController.cs | 4 +- samples/My.Hr/My.Hr.Api/My.Hr.Api.csproj | 2 +- .../My.Hr.Business/My.Hr.Business.csproj | 8 +- .../Agents/Generated/ReferenceDataAgent.cs | 49 ++----------- .../My.Hr/My.Hr.Common/My.Hr.Common.csproj | 2 +- samples/My.Hr/My.Hr.Test/My.Hr.Test.csproj | 4 +- .../Resources/RefDataGetNamed_Response.json | 47 ++++++------ .../Generated/ReferenceDataController.cs | 4 +- .../MyEf.Hr/MyEf.Hr.Api/MyEf.Hr.Api.csproj | 4 +- .../MyEf.Hr.Business/MyEf.Hr.Business.csproj | 8 +- .../Agents/Generated/ReferenceDataAgent.cs | 49 ++----------- .../MyEf.Hr.Common/MyEf.Hr.Common.csproj | 2 +- .../MyEf.Hr.Security.Subscriptions.csproj | 4 +- .../MyEf.Hr.Security.Test.csproj | 2 +- .../MyEf.Hr/MyEf.Hr.Test/MyEf.Hr.Test.csproj | 4 +- .../Resources/RefDataGetNamed_Response.json | 47 ++++++------ .../content/.template.config/template.json | 4 +- tools/Beef.CodeGen.Core/CodeGenerator.cs | 2 +- .../Templates/ReferenceDataWebApiAgent_cs.hbs | 17 +---- .../ReferenceDataWebApiController_cs.hbs | 4 +- .../Beef.Database.Core.csproj | 2 +- .../Beef.Database.MySql.csproj | 2 +- .../Beef.Database.SqlServer.csproj | 2 +- tools/Beef.Test.NUnit/Beef.Test.NUnit.csproj | 2 +- 39 files changed, 132 insertions(+), 320 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 52e38151a..80513c268 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,9 @@ Represents the **NuGet** versions. +## v5.7.4 +- *Fixed:* Upgraded `CoreEx` (`v3.7.2`) to include all related fixes and improvements; updated reference data code-generation template and samples as a result. + ## v5.7.3 - *Fixed:* The `clean` code-generation command supports new path exclusion capabilities; see `dotnet 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. diff --git a/Common.targets b/Common.targets index d13fa4cb5..0a5a321e4 100644 --- a/Common.targets +++ b/Common.targets @@ -1,6 +1,6 @@ - 5.7.3 + 5.7.4 preview Avanade Avanade diff --git a/samples/Cdr.Banking/Cdr.Banking.Api/Cdr.Banking.Api.csproj b/samples/Cdr.Banking/Cdr.Banking.Api/Cdr.Banking.Api.csproj index acc4195c6..d43b75c2b 100644 --- a/samples/Cdr.Banking/Cdr.Banking.Api/Cdr.Banking.Api.csproj +++ b/samples/Cdr.Banking/Cdr.Banking.Api/Cdr.Banking.Api.csproj @@ -5,7 +5,7 @@ true - + diff --git a/samples/Cdr.Banking/Cdr.Banking.Api/Controllers/Generated/ReferenceDataController.cs b/samples/Cdr.Banking/Cdr.Banking.Api/Controllers/Generated/ReferenceDataController.cs index 2664f7eb6..aa1845f4c 100644 --- a/samples/Cdr.Banking/Cdr.Banking.Api/Controllers/Generated/ReferenceDataController.cs +++ b/samples/Cdr.Banking/Cdr.Banking.Api/Controllers/Generated/ReferenceDataController.cs @@ -97,10 +97,10 @@ public Task TransactionStatusGetAll([FromQuery] IEnumerable /// Gets the reference data entries for the specified entities and codes from the query string; e.g: api/v1/ref?entity=codeX,codeY&entity2=codeZ&entity3 /// - /// A . + /// A . [HttpGet()] [Route("api/v1/ref")] - [ProducesResponseType(typeof(IEnumerable), (int)HttpStatusCode.OK)] + [ProducesResponseType(typeof(IEnumerable), (int)HttpStatusCode.OK)] [ApiExplorerSettings(IgnoreApi = true)] public Task GetNamed() => _webApi.GetAsync(Request, p => _orchestrator.GetNamedAsync(p.RequestOptions)); } \ No newline at end of file diff --git a/samples/Cdr.Banking/Cdr.Banking.Business/Cdr.Banking.Business.csproj b/samples/Cdr.Banking/Cdr.Banking.Business/Cdr.Banking.Business.csproj index 019d47937..3a80bceb3 100644 --- a/samples/Cdr.Banking/Cdr.Banking.Business/Cdr.Banking.Business.csproj +++ b/samples/Cdr.Banking/Cdr.Banking.Business/Cdr.Banking.Business.csproj @@ -11,7 +11,7 @@ - - + + \ No newline at end of file diff --git a/samples/Cdr.Banking/Cdr.Banking.Common/Agents/Generated/ReferenceDataAgent.cs b/samples/Cdr.Banking/Cdr.Banking.Common/Agents/Generated/ReferenceDataAgent.cs index 7ed7312e1..9b318159f 100644 --- a/samples/Cdr.Banking/Cdr.Banking.Common/Agents/Generated/ReferenceDataAgent.cs +++ b/samples/Cdr.Banking/Cdr.Banking.Common/Agents/Generated/ReferenceDataAgent.cs @@ -34,74 +34,31 @@ public partial class ReferenceDataAgent : TypedHttpClientBase logger) : base(client, jsonSerializer, executionContext, settings, logger) { } - /// - /// Gets all of the items that match the filter arguments. - /// - /// The optional arguments. - /// The optional . - /// The . - /// A . + /// public Task> OpenStatusGetAllAsync(ReferenceDataFilter? args = null, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) => GetAsync("api/v1/ref/openstatuses", requestOptions: requestOptions, args: HttpArgs.Create(new HttpArg("args", args!, HttpArgType.FromUriUseProperties)), cancellationToken); - /// - /// Gets all of the items that match the filter arguments. - /// - /// The optional arguments. - /// The optional . - /// The . - /// A . + /// public Task> ProductCategoryGetAllAsync(ReferenceDataFilter? args = null, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) => GetAsync("api/v1/ref/productcategories", requestOptions: requestOptions, args: HttpArgs.Create(new HttpArg("args", args!, HttpArgType.FromUriUseProperties)), cancellationToken); - /// - /// Gets all of the items that match the filter arguments. - /// - /// The optional arguments. - /// The optional . - /// The . - /// A . + /// public Task> AccountUTypeGetAllAsync(ReferenceDataFilter? args = null, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) => GetAsync("api/v1/ref/accountutypes", requestOptions: requestOptions, args: HttpArgs.Create(new HttpArg("args", args!, HttpArgType.FromUriUseProperties)), cancellationToken); - /// - /// Gets all of the items that match the filter arguments. - /// - /// The optional arguments. - /// The optional . - /// The . - /// A . + /// public Task> MaturityInstructionsGetAllAsync(ReferenceDataFilter? args = null, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) => GetAsync("api/v1/ref/maturityinstructions", requestOptions: requestOptions, args: HttpArgs.Create(new HttpArg("args", args!, HttpArgType.FromUriUseProperties)), cancellationToken); - /// - /// Gets all of the items that match the filter arguments. - /// - /// The optional arguments. - /// The optional . - /// The . - /// A . + /// public Task> TransactionTypeGetAllAsync(ReferenceDataFilter? args = null, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) => GetAsync("api/v1/ref/transactiontypes", requestOptions: requestOptions, args: HttpArgs.Create(new HttpArg("args", args!, HttpArgType.FromUriUseProperties)), cancellationToken); - /// - /// Gets all of the items that match the filter arguments. - /// - /// The optional arguments. - /// The optional . - /// The . - /// A . + /// public Task> TransactionStatusGetAllAsync(ReferenceDataFilter? args = null, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) => GetAsync("api/v1/ref/transactionstatuses", requestOptions: requestOptions, args: HttpArgs.Create(new HttpArg("args", args!, HttpArgType.FromUriUseProperties)), cancellationToken); - /// - /// Gets the reference data entries for the specified entities and codes from the query string; e.g: api/v1/ref?entity=codeX,codeY&entity2=codeZ&entity3 - /// - /// The optional list of reference data names. - /// The optional . - /// The . - /// A . - /// The reference data objects will need to be manually extracted from the corresponding response content. + /// public Task GetNamedAsync(string[] names, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) { var ro = requestOptions ?? new HttpRequestOptions(); diff --git a/samples/Cdr.Banking/Cdr.Banking.Common/Cdr.Banking.Common.csproj b/samples/Cdr.Banking/Cdr.Banking.Common/Cdr.Banking.Common.csproj index ad44ff844..8b6557231 100644 --- a/samples/Cdr.Banking/Cdr.Banking.Common/Cdr.Banking.Common.csproj +++ b/samples/Cdr.Banking/Cdr.Banking.Common/Cdr.Banking.Common.csproj @@ -8,6 +8,6 @@ - + \ No newline at end of file diff --git a/samples/Cdr.Banking/Cdr.Banking.Test/Cdr.Banking.Test.csproj b/samples/Cdr.Banking/Cdr.Banking.Test/Cdr.Banking.Test.csproj index 3d001d1cc..aad6e9978 100644 --- a/samples/Cdr.Banking/Cdr.Banking.Test/Cdr.Banking.Test.csproj +++ b/samples/Cdr.Banking/Cdr.Banking.Test/Cdr.Banking.Test.csproj @@ -35,7 +35,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/samples/Demo/Beef.Demo.Api/Beef.Demo.Api.csproj b/samples/Demo/Beef.Demo.Api/Beef.Demo.Api.csproj index 1b75fc709..3e3000b60 100644 --- a/samples/Demo/Beef.Demo.Api/Beef.Demo.Api.csproj +++ b/samples/Demo/Beef.Demo.Api/Beef.Demo.Api.csproj @@ -12,7 +12,7 @@ - + diff --git a/samples/Demo/Beef.Demo.Api/Controllers/Generated/ReferenceDataController.cs b/samples/Demo/Beef.Demo.Api/Controllers/Generated/ReferenceDataController.cs index a9774ad6e..4e16dcea6 100644 --- a/samples/Demo/Beef.Demo.Api/Controllers/Generated/ReferenceDataController.cs +++ b/samples/Demo/Beef.Demo.Api/Controllers/Generated/ReferenceDataController.cs @@ -133,11 +133,11 @@ public Task CommunicationTypeGetAll([FromQuery] IEnumerable /// Gets the reference data entries for the specified entities and codes from the query string; e.g: api/v1/demo/ref?entity=codeX,codeY&entity2=codeZ&entity3 /// - /// A . + /// A . [AllowAnonymous] [HttpGet()] [Route("api/v1/demo/ref")] - [ProducesResponseType(typeof(IEnumerable), (int)HttpStatusCode.OK)] + [ProducesResponseType(typeof(IEnumerable), (int)HttpStatusCode.OK)] [ApiExplorerSettings(IgnoreApi = true)] public Task GetNamed() => _webApi.GetAsync(Request, p => _orchestrator.GetNamedAsync(p.RequestOptions)); } diff --git a/samples/Demo/Beef.Demo.Business/Beef.Demo.Business.csproj b/samples/Demo/Beef.Demo.Business/Beef.Demo.Business.csproj index 1d37bd46d..1d0672442 100644 --- a/samples/Demo/Beef.Demo.Business/Beef.Demo.Business.csproj +++ b/samples/Demo/Beef.Demo.Business/Beef.Demo.Business.csproj @@ -15,13 +15,13 @@ - - - - - - - + + + + + + + diff --git a/samples/Demo/Beef.Demo.Common/Agents/Generated/ReferenceDataAgent.cs b/samples/Demo/Beef.Demo.Common/Agents/Generated/ReferenceDataAgent.cs index 3aff5e299..4b662a140 100644 --- a/samples/Demo/Beef.Demo.Common/Agents/Generated/ReferenceDataAgent.cs +++ b/samples/Demo/Beef.Demo.Common/Agents/Generated/ReferenceDataAgent.cs @@ -37,94 +37,39 @@ public partial class ReferenceDataAgent : TypedHttpClientBase logger) : base(client, jsonSerializer, executionContext, settings, logger) { } - /// - /// Gets all of the items that match the filter arguments. - /// - /// The optional arguments. - /// The optional . - /// The . - /// A . + /// public Task> CountryGetAllAsync(ReferenceDataFilter? args = null, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) => GetAsync("api/v1/demo/ref/countries", requestOptions: requestOptions, args: HttpArgs.Create(new HttpArg("args", args!, HttpArgType.FromUriUseProperties)), cancellationToken); - /// - /// Gets all of the items that match the filter arguments. - /// - /// The optional arguments. - /// The optional . - /// The . - /// A . + /// public Task> USStateGetAllAsync(ReferenceDataFilter? args = null, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) => GetAsync("api/v1/demo/ref/usStates", requestOptions: requestOptions, args: HttpArgs.Create(new HttpArg("args", args!, HttpArgType.FromUriUseProperties)), cancellationToken); - /// - /// Gets all of the items that match the filter arguments. - /// - /// The optional arguments. - /// The optional . - /// The . - /// A . + /// public Task> GenderGetAllAsync(ReferenceDataFilter? args = null, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) => GetAsync("api/v1/demo/ref/genders", requestOptions: requestOptions, args: HttpArgs.Create(new HttpArg("args", args!, HttpArgType.FromUriUseProperties)), cancellationToken); - /// - /// Gets all of the items that match the filter arguments. - /// - /// The optional arguments. - /// The optional . - /// The . - /// A . + /// public Task> EyeColorGetAllAsync(ReferenceDataFilter? args = null, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) => GetAsync("api/v1/demo/ref/eyeColors", requestOptions: requestOptions, args: HttpArgs.Create(new HttpArg("args", args!, HttpArgType.FromUriUseProperties)), cancellationToken); - /// - /// Gets all of the items that match the filter arguments. - /// - /// The optional arguments. - /// The optional . - /// The . - /// A . + /// public Task> PowerSourceGetAllAsync(ReferenceDataFilter? args = null, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) => GetAsync("api/v1/demo/ref/powerSources", requestOptions: requestOptions, args: HttpArgs.Create(new HttpArg("args", args!, HttpArgType.FromUriUseProperties)), cancellationToken); - /// - /// Gets all of the items that match the filter arguments. - /// - /// The optional arguments. - /// The optional . - /// The . - /// A . + /// public Task> CompanyGetAllAsync(ReferenceDataFilter? args = null, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) => GetAsync("api/v1/demo/ref/companies", requestOptions: requestOptions, args: HttpArgs.Create(new HttpArg("args", args!, HttpArgType.FromUriUseProperties)), cancellationToken); - /// - /// Gets all of the items that match the filter arguments. - /// - /// The optional arguments. - /// The optional . - /// The . - /// A . + /// public Task> StatusGetAllAsync(ReferenceDataFilter? args = null, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) => GetAsync("api/v1/demo/ref/statuses", requestOptions: requestOptions, args: HttpArgs.Create(new HttpArg("args", args!, HttpArgType.FromUriUseProperties)), cancellationToken); - /// - /// Gets all of the items that match the filter arguments. - /// - /// The optional arguments. - /// The optional . - /// The . - /// A . + /// public Task> CommunicationTypeGetAllAsync(ReferenceDataFilter? args = null, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) => GetAsync("api/v1/demo/ref/communicationTypes", requestOptions: requestOptions, args: HttpArgs.Create(new HttpArg("args", args!, HttpArgType.FromUriUseProperties)), cancellationToken); - /// - /// Gets the reference data entries for the specified entities and codes from the query string; e.g: api/v1/demo/ref?entity=codeX,codeY&entity2=codeZ&entity3 - /// - /// The optional list of reference data names. - /// The optional . - /// The . - /// A . - /// The reference data objects will need to be manually extracted from the corresponding response content. + /// public Task GetNamedAsync(string[] names, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) { var ro = requestOptions ?? new HttpRequestOptions(); diff --git a/samples/Demo/Beef.Demo.Common/Beef.Demo.Common.csproj b/samples/Demo/Beef.Demo.Common/Beef.Demo.Common.csproj index 1c01146e3..61c9d4463 100644 --- a/samples/Demo/Beef.Demo.Common/Beef.Demo.Common.csproj +++ b/samples/Demo/Beef.Demo.Common/Beef.Demo.Common.csproj @@ -7,7 +7,7 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/samples/Demo/Beef.Demo.Test/Beef.Demo.Test.csproj b/samples/Demo/Beef.Demo.Test/Beef.Demo.Test.csproj index 1432e594e..000b7f91b 100644 --- a/samples/Demo/Beef.Demo.Test/Beef.Demo.Test.csproj +++ b/samples/Demo/Beef.Demo.Test/Beef.Demo.Test.csproj @@ -52,7 +52,7 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/samples/Demo/Beef.Demo.Test/ReferenceDataTest.cs b/samples/Demo/Beef.Demo.Test/ReferenceDataTest.cs index f83a0615f..8104631ef 100644 --- a/samples/Demo/Beef.Demo.Test/ReferenceDataTest.cs +++ b/samples/Demo/Beef.Demo.Test/ReferenceDataTest.cs @@ -159,8 +159,8 @@ public void A180_GetByCodes() { var r = Agent() .ExpectStatusCode(HttpStatusCode.OK) - .Run(a => a.GetNamedAsync(Array.Empty(), new CoreEx.Http.HttpRequestOptions { UrlQueryString = "gender=m,f&powerSource=e&powerSource=f&eyecolor&$include=name,items.code" })) - .AssertJson("[{\"name\":\"Gender\",\"items\":[{\"code\":\"M\"},{\"code\":\"F\"}]},{\"name\":\"PowerSource\",\"items\":[{\"code\":\"E\"},{\"code\":\"F\"}]},{\"name\":\"EyeColor\",\"items\":[{\"code\":\"BLUE\"},{\"code\":\"BROWN\"},{\"code\":\"GREEN\"}]}]"); + .Run(a => a.GetNamedAsync(Array.Empty(), new CoreEx.Http.HttpRequestOptions { UrlQueryString = "gender=m,f&powerSource=e&powerSource=f&eyecolor&$include=gender.code,gender.text,powersource.code,powersource.text,eyecolor.code,eyecolor.text" })) + .AssertJson("{\"gender\":[{\"code\":\"M\",\"text\":\"Male\"},{\"code\":\"F\",\"text\":\"Female\"}],\"powerSource\":[{\"code\":\"E\",\"text\":\"Electrical\"},{\"code\":\"F\",\"text\":\"Fusion\"}],\"eyeColor\":[{\"code\":\"BLUE\",\"text\":\"Blue\"},{\"code\":\"BROWN\",\"text\":\"Brown\"},{\"code\":\"GREEN\",\"text\":\"Green\"}]}"); } [Test, Parallelizable] diff --git a/samples/My.Hr/My.Hr.Api/Controllers/Generated/ReferenceDataController.cs b/samples/My.Hr/My.Hr.Api/Controllers/Generated/ReferenceDataController.cs index e002ec4a0..377c937b2 100644 --- a/samples/My.Hr/My.Hr.Api/Controllers/Generated/ReferenceDataController.cs +++ b/samples/My.Hr/My.Hr.Api/Controllers/Generated/ReferenceDataController.cs @@ -85,10 +85,10 @@ public Task PerformanceOutcomeGetAll([FromQuery] IEnumerable /// Gets the reference data entries for the specified entities and codes from the query string; e.g: ref?entity=codeX,codeY&entity2=codeZ&entity3 /// - /// A . + /// A . [HttpGet()] [Route("ref")] - [ProducesResponseType(typeof(IEnumerable), (int)HttpStatusCode.OK)] + [ProducesResponseType(typeof(IEnumerable), (int)HttpStatusCode.OK)] [ApiExplorerSettings(IgnoreApi = true)] public Task GetNamed() => _webApi.GetAsync(Request, p => _orchestrator.GetNamedAsync(p.RequestOptions)); } \ No newline at end of file diff --git a/samples/My.Hr/My.Hr.Api/My.Hr.Api.csproj b/samples/My.Hr/My.Hr.Api/My.Hr.Api.csproj index 05e656ee6..0d4eeeec5 100644 --- a/samples/My.Hr/My.Hr.Api/My.Hr.Api.csproj +++ b/samples/My.Hr/My.Hr.Api/My.Hr.Api.csproj @@ -5,7 +5,7 @@ true - + diff --git a/samples/My.Hr/My.Hr.Business/My.Hr.Business.csproj b/samples/My.Hr/My.Hr.Business/My.Hr.Business.csproj index e6c73f637..8498eab04 100644 --- a/samples/My.Hr/My.Hr.Business/My.Hr.Business.csproj +++ b/samples/My.Hr/My.Hr.Business/My.Hr.Business.csproj @@ -5,10 +5,10 @@ true - - - - + + + + \ No newline at end of file diff --git a/samples/My.Hr/My.Hr.Common/Agents/Generated/ReferenceDataAgent.cs b/samples/My.Hr/My.Hr.Common/Agents/Generated/ReferenceDataAgent.cs index cb48b8f44..169daf33a 100644 --- a/samples/My.Hr/My.Hr.Common/Agents/Generated/ReferenceDataAgent.cs +++ b/samples/My.Hr/My.Hr.Common/Agents/Generated/ReferenceDataAgent.cs @@ -34,64 +34,27 @@ public partial class ReferenceDataAgent : TypedHttpClientBase logger) : base(client, jsonSerializer, executionContext, settings, logger) { } - /// - /// Gets all of the items that match the filter arguments. - /// - /// The optional arguments. - /// The optional . - /// The . - /// A . + /// public Task> GenderGetAllAsync(ReferenceDataFilter? args = null, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) => GetAsync("ref/genders", requestOptions: requestOptions, args: HttpArgs.Create(new HttpArg("args", args!, HttpArgType.FromUriUseProperties)), cancellationToken); - /// - /// Gets all of the items that match the filter arguments. - /// - /// The optional arguments. - /// The optional . - /// The . - /// A . + /// public Task> TerminationReasonGetAllAsync(ReferenceDataFilter? args = null, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) => GetAsync("ref/terminationReasons", requestOptions: requestOptions, args: HttpArgs.Create(new HttpArg("args", args!, HttpArgType.FromUriUseProperties)), cancellationToken); - /// - /// Gets all of the items that match the filter arguments. - /// - /// The optional arguments. - /// The optional . - /// The . - /// A . + /// public Task> RelationshipTypeGetAllAsync(ReferenceDataFilter? args = null, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) => GetAsync("ref/relationshipTypes", requestOptions: requestOptions, args: HttpArgs.Create(new HttpArg("args", args!, HttpArgType.FromUriUseProperties)), cancellationToken); - /// - /// Gets all of the items that match the filter arguments. - /// - /// The optional arguments. - /// The optional . - /// The . - /// A . + /// public Task> USStateGetAllAsync(ReferenceDataFilter? args = null, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) => GetAsync("ref/usStates", requestOptions: requestOptions, args: HttpArgs.Create(new HttpArg("args", args!, HttpArgType.FromUriUseProperties)), cancellationToken); - /// - /// Gets all of the items that match the filter arguments. - /// - /// The optional arguments. - /// The optional . - /// The . - /// A . + /// public Task> PerformanceOutcomeGetAllAsync(ReferenceDataFilter? args = null, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) => GetAsync("ref/performanceOutcomes", requestOptions: requestOptions, args: HttpArgs.Create(new HttpArg("args", args!, HttpArgType.FromUriUseProperties)), cancellationToken); - /// - /// Gets the reference data entries for the specified entities and codes from the query string; e.g: ref?entity=codeX,codeY&entity2=codeZ&entity3 - /// - /// The optional list of reference data names. - /// The optional . - /// The . - /// A . - /// The reference data objects will need to be manually extracted from the corresponding response content. + /// public Task GetNamedAsync(string[] names, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) { var ro = requestOptions ?? new HttpRequestOptions(); diff --git a/samples/My.Hr/My.Hr.Common/My.Hr.Common.csproj b/samples/My.Hr/My.Hr.Common/My.Hr.Common.csproj index 21f764c28..42e682af7 100644 --- a/samples/My.Hr/My.Hr.Common/My.Hr.Common.csproj +++ b/samples/My.Hr/My.Hr.Common/My.Hr.Common.csproj @@ -4,6 +4,6 @@ enable - + \ No newline at end of file diff --git a/samples/My.Hr/My.Hr.Test/My.Hr.Test.csproj b/samples/My.Hr/My.Hr.Test/My.Hr.Test.csproj index 609940eb0..db4afa995 100644 --- a/samples/My.Hr/My.Hr.Test/My.Hr.Test.csproj +++ b/samples/My.Hr/My.Hr.Test/My.Hr.Test.csproj @@ -32,13 +32,13 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/samples/My.Hr/My.Hr.Test/Resources/RefDataGetNamed_Response.json b/samples/My.Hr/My.Hr.Test/Resources/RefDataGetNamed_Response.json index 10283c6dc..d02067453 100644 --- a/samples/My.Hr/My.Hr.Test/Resources/RefDataGetNamed_Response.json +++ b/samples/My.Hr/My.Hr.Test/Resources/RefDataGetNamed_Response.json @@ -1,25 +1,22 @@ -[ - { - "name": "Gender", - "items": [ - { - "code": "F", - "text": "Female", - "sortOrder": 1, - "isActive": true - }, - { - "code": "M", - "text": "Male", - "sortOrder": 2, - "isActive": true - }, - { - "code": "N", - "text": "Not specified", - "sortOrder": 3, - "isActive": true - } - ] - } -] \ No newline at end of file +{ + "gender": [ + { + "code": "F", + "text": "Female", + "sortOrder": 1, + "isActive": true + }, + { + "code": "M", + "text": "Male", + "sortOrder": 2, + "isActive": true + }, + { + "code": "N", + "text": "Not specified", + "sortOrder": 3, + "isActive": true + } + ] +} \ No newline at end of file diff --git a/samples/MyEf.Hr/MyEf.Hr.Api/Controllers/Generated/ReferenceDataController.cs b/samples/MyEf.Hr/MyEf.Hr.Api/Controllers/Generated/ReferenceDataController.cs index 23c23f786..ed4e31ef1 100644 --- a/samples/MyEf.Hr/MyEf.Hr.Api/Controllers/Generated/ReferenceDataController.cs +++ b/samples/MyEf.Hr/MyEf.Hr.Api/Controllers/Generated/ReferenceDataController.cs @@ -85,10 +85,10 @@ public Task PerformanceOutcomeGetAll([FromQuery] IEnumerable /// Gets the reference data entries for the specified entities and codes from the query string; e.g: ref?entity=codeX,codeY&entity2=codeZ&entity3 /// - /// A . + /// A . [HttpGet()] [Route("ref")] - [ProducesResponseType(typeof(IEnumerable), (int)HttpStatusCode.OK)] + [ProducesResponseType(typeof(IEnumerable), (int)HttpStatusCode.OK)] [ApiExplorerSettings(IgnoreApi = true)] public Task GetNamed() => _webApi.GetAsync(Request, p => _orchestrator.GetNamedAsync(p.RequestOptions)); } \ No newline at end of file diff --git a/samples/MyEf.Hr/MyEf.Hr.Api/MyEf.Hr.Api.csproj b/samples/MyEf.Hr/MyEf.Hr.Api/MyEf.Hr.Api.csproj index 33e2f7952..d3256b4d4 100644 --- a/samples/MyEf.Hr/MyEf.Hr.Api/MyEf.Hr.Api.csproj +++ b/samples/MyEf.Hr/MyEf.Hr.Api/MyEf.Hr.Api.csproj @@ -6,8 +6,8 @@ True - - + + diff --git a/samples/MyEf.Hr/MyEf.Hr.Business/MyEf.Hr.Business.csproj b/samples/MyEf.Hr/MyEf.Hr.Business/MyEf.Hr.Business.csproj index e23077b61..25a4e0826 100644 --- a/samples/MyEf.Hr/MyEf.Hr.Business/MyEf.Hr.Business.csproj +++ b/samples/MyEf.Hr/MyEf.Hr.Business/MyEf.Hr.Business.csproj @@ -5,10 +5,10 @@ true - - - - + + + + diff --git a/samples/MyEf.Hr/MyEf.Hr.Common/Agents/Generated/ReferenceDataAgent.cs b/samples/MyEf.Hr/MyEf.Hr.Common/Agents/Generated/ReferenceDataAgent.cs index 2ed3d7331..2dad6add1 100644 --- a/samples/MyEf.Hr/MyEf.Hr.Common/Agents/Generated/ReferenceDataAgent.cs +++ b/samples/MyEf.Hr/MyEf.Hr.Common/Agents/Generated/ReferenceDataAgent.cs @@ -34,64 +34,27 @@ public partial class ReferenceDataAgent : TypedHttpClientBase logger) : base(client, jsonSerializer, executionContext, settings, logger) { } - /// - /// Gets all of the items that match the filter arguments. - /// - /// The optional arguments. - /// The optional . - /// The . - /// A . + /// public Task> GenderGetAllAsync(ReferenceDataFilter? args = null, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) => GetAsync("ref/genders", requestOptions: requestOptions, args: HttpArgs.Create(new HttpArg("args", args!, HttpArgType.FromUriUseProperties)), cancellationToken); - /// - /// Gets all of the items that match the filter arguments. - /// - /// The optional arguments. - /// The optional . - /// The . - /// A . + /// public Task> TerminationReasonGetAllAsync(ReferenceDataFilter? args = null, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) => GetAsync("ref/terminationreasons", requestOptions: requestOptions, args: HttpArgs.Create(new HttpArg("args", args!, HttpArgType.FromUriUseProperties)), cancellationToken); - /// - /// Gets all of the items that match the filter arguments. - /// - /// The optional arguments. - /// The optional . - /// The . - /// A . + /// public Task> RelationshipTypeGetAllAsync(ReferenceDataFilter? args = null, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) => GetAsync("ref/relationshiptypes", requestOptions: requestOptions, args: HttpArgs.Create(new HttpArg("args", args!, HttpArgType.FromUriUseProperties)), cancellationToken); - /// - /// Gets all of the items that match the filter arguments. - /// - /// The optional arguments. - /// The optional . - /// The . - /// A . + /// public Task> USStateGetAllAsync(ReferenceDataFilter? args = null, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) => GetAsync("ref/usstates", requestOptions: requestOptions, args: HttpArgs.Create(new HttpArg("args", args!, HttpArgType.FromUriUseProperties)), cancellationToken); - /// - /// Gets all of the items that match the filter arguments. - /// - /// The optional arguments. - /// The optional . - /// The . - /// A . + /// public Task> PerformanceOutcomeGetAllAsync(ReferenceDataFilter? args = null, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) => GetAsync("ref/performanceoutcomes", requestOptions: requestOptions, args: HttpArgs.Create(new HttpArg("args", args!, HttpArgType.FromUriUseProperties)), cancellationToken); - /// - /// Gets the reference data entries for the specified entities and codes from the query string; e.g: ref?entity=codeX,codeY&entity2=codeZ&entity3 - /// - /// The optional list of reference data names. - /// The optional . - /// The . - /// A . - /// The reference data objects will need to be manually extracted from the corresponding response content. + /// public Task GetNamedAsync(string[] names, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) { var ro = requestOptions ?? new HttpRequestOptions(); diff --git a/samples/MyEf.Hr/MyEf.Hr.Common/MyEf.Hr.Common.csproj b/samples/MyEf.Hr/MyEf.Hr.Common/MyEf.Hr.Common.csproj index 21f764c28..42e682af7 100644 --- a/samples/MyEf.Hr/MyEf.Hr.Common/MyEf.Hr.Common.csproj +++ b/samples/MyEf.Hr/MyEf.Hr.Common/MyEf.Hr.Common.csproj @@ -4,6 +4,6 @@ enable - + \ No newline at end of file diff --git a/samples/MyEf.Hr/MyEf.Hr.Security.Subscriptions/MyEf.Hr.Security.Subscriptions.csproj b/samples/MyEf.Hr/MyEf.Hr.Security.Subscriptions/MyEf.Hr.Security.Subscriptions.csproj index 9ae789ba3..2b95bf3c8 100644 --- a/samples/MyEf.Hr/MyEf.Hr.Security.Subscriptions/MyEf.Hr.Security.Subscriptions.csproj +++ b/samples/MyEf.Hr/MyEf.Hr.Security.Subscriptions/MyEf.Hr.Security.Subscriptions.csproj @@ -16,8 +16,8 @@ - - + + diff --git a/samples/MyEf.Hr/MyEf.Hr.Security.Test/MyEf.Hr.Security.Test.csproj b/samples/MyEf.Hr/MyEf.Hr.Security.Test/MyEf.Hr.Security.Test.csproj index 028523ac9..7a14bc100 100644 --- a/samples/MyEf.Hr/MyEf.Hr.Security.Test/MyEf.Hr.Security.Test.csproj +++ b/samples/MyEf.Hr/MyEf.Hr.Security.Test/MyEf.Hr.Security.Test.csproj @@ -28,7 +28,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/samples/MyEf.Hr/MyEf.Hr.Test/MyEf.Hr.Test.csproj b/samples/MyEf.Hr/MyEf.Hr.Test/MyEf.Hr.Test.csproj index 22080f350..5ed2a24a8 100644 --- a/samples/MyEf.Hr/MyEf.Hr.Test/MyEf.Hr.Test.csproj +++ b/samples/MyEf.Hr/MyEf.Hr.Test/MyEf.Hr.Test.csproj @@ -32,13 +32,13 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/samples/MyEf.Hr/MyEf.Hr.Test/Resources/RefDataGetNamed_Response.json b/samples/MyEf.Hr/MyEf.Hr.Test/Resources/RefDataGetNamed_Response.json index 10283c6dc..d02067453 100644 --- a/samples/MyEf.Hr/MyEf.Hr.Test/Resources/RefDataGetNamed_Response.json +++ b/samples/MyEf.Hr/MyEf.Hr.Test/Resources/RefDataGetNamed_Response.json @@ -1,25 +1,22 @@ -[ - { - "name": "Gender", - "items": [ - { - "code": "F", - "text": "Female", - "sortOrder": 1, - "isActive": true - }, - { - "code": "M", - "text": "Male", - "sortOrder": 2, - "isActive": true - }, - { - "code": "N", - "text": "Not specified", - "sortOrder": 3, - "isActive": true - } - ] - } -] \ No newline at end of file +{ + "gender": [ + { + "code": "F", + "text": "Female", + "sortOrder": 1, + "isActive": true + }, + { + "code": "M", + "text": "Male", + "sortOrder": 2, + "isActive": true + }, + { + "code": "N", + "text": "Not specified", + "sortOrder": 3, + "isActive": true + } + ] +} \ No newline at end of file diff --git a/templates/Beef.Template.Solution/content/.template.config/template.json b/templates/Beef.Template.Solution/content/.template.config/template.json index 38a4764d3..92f2ecbed 100644 --- a/templates/Beef.Template.Solution/content/.template.config/template.json +++ b/templates/Beef.Template.Solution/content/.template.config/template.json @@ -65,7 +65,7 @@ "type": "generated", "generator": "constant", "parameters": { - "value": "3.7.0" + "value": "3.7.2" }, "replaces": "CoreExVersion" }, @@ -73,7 +73,7 @@ "type": "generated", "generator": "constant", "parameters": { - "value": "5.7.2" + "value": "5.7.4" }, "replaces": "BeefVersion" }, diff --git a/tools/Beef.CodeGen.Core/CodeGenerator.cs b/tools/Beef.CodeGen.Core/CodeGenerator.cs index 27b14662c..a55155343 100644 --- a/tools/Beef.CodeGen.Core/CodeGenerator.cs +++ b/tools/Beef.CodeGen.Core/CodeGenerator.cs @@ -44,7 +44,7 @@ protected override void OnAfterScript(CodeGenScriptItem script, CodeGenStatistic list.Add(("ReferenceData.GetNamed", cgc.RefDataWebApiRoute!, "GET", "OK", cgc.WebApiAuthorize)); foreach (var e in cgc.Root!.RefDataEntities!) { - list.Add(($"ReferenceData.{e.Name}GetAll", e.WebApiRoutePrefix!, "GET", "OK", e.WebApiAuthorize)); + list.Add(($"ReferenceData.{e.Name}GetAll", e.WebApiRoutePrefix!, "GET", "OK", e.WebApiAuthorize ?? "")); } LogEndpoints(script, list); diff --git a/tools/Beef.CodeGen.Core/Templates/ReferenceDataWebApiAgent_cs.hbs b/tools/Beef.CodeGen.Core/Templates/ReferenceDataWebApiAgent_cs.hbs index 7576baa30..391378e2a 100644 --- a/tools/Beef.CodeGen.Core/Templates/ReferenceDataWebApiAgent_cs.hbs +++ b/tools/Beef.CodeGen.Core/Templates/ReferenceDataWebApiAgent_cs.hbs @@ -42,25 +42,12 @@ namespace {{Root.NamespaceCommon}}.Agents : base(client, jsonSerializer, executionContext, settings, logger) { } {{#each RefDataEntities}} - /// - /// Gets all of the {{see-comments RefDataQualifiedEntityName}} items that match the filter arguments. - /// - /// The optional arguments. - /// The optional . - /// The . - /// A . + /// public Task> {{Name}}GetAllAsync(ReferenceDataFilter? args = null, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) => GetAsync<{{RefDataQualifiedEntityCollectionName}}>("{{WebApiRoutePrefix}}", requestOptions: requestOptions, args: HttpArgs.Create(new HttpArg("args", args!, HttpArgType.FromUriUseProperties)), cancellationToken); {{/each}} - /// - /// Gets the reference data entries for the specified entities and codes from the query string; e.g: {{RefDataWebApiRoute}}?entity=codeX,codeY&entity2=codeZ&entity3 - /// - /// The optional list of reference data names. - /// The optional . - /// The . - /// A . - /// The reference data objects will need to be manually extracted from the corresponding response content. + /// public Task GetNamedAsync(string[] names, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) { var ro = requestOptions ?? new HttpRequestOptions(); diff --git a/tools/Beef.CodeGen.Core/Templates/ReferenceDataWebApiController_cs.hbs b/tools/Beef.CodeGen.Core/Templates/ReferenceDataWebApiController_cs.hbs index 580497727..8a89c6b08 100644 --- a/tools/Beef.CodeGen.Core/Templates/ReferenceDataWebApiController_cs.hbs +++ b/tools/Beef.CodeGen.Core/Templates/ReferenceDataWebApiController_cs.hbs @@ -52,13 +52,13 @@ public partial class ReferenceDataController : ControllerBase /// /// Gets the reference data entries for the specified entities and codes from the query string; e.g: {{Root.RefDataWebApiRoute}}?entity=codeX,codeY&entity2=codeZ&entity3 /// - /// A . + /// A . {{#ifval WebApiAuthorize}} [{{{WebApiAuthorize}}}] {{/ifval}} [HttpGet()] [Route("{{RefDataWebApiRoute}}")] - [ProducesResponseType(typeof(IEnumerable), (int)HttpStatusCode.OK)] + [ProducesResponseType(typeof(IEnumerable), (int)HttpStatusCode.OK)] [ApiExplorerSettings(IgnoreApi = true)] public Task GetNamed() => _webApi.GetAsync(Request, p => _orchestrator.GetNamedAsync(p.RequestOptions)); }{{#if Root.PreprocessorDirectives}} diff --git a/tools/Beef.Database.Core/Beef.Database.Core.csproj b/tools/Beef.Database.Core/Beef.Database.Core.csproj index ed87c8637..7a022245a 100644 --- a/tools/Beef.Database.Core/Beef.Database.Core.csproj +++ b/tools/Beef.Database.Core/Beef.Database.Core.csproj @@ -14,7 +14,7 @@ - + diff --git a/tools/Beef.Database.MySql/Beef.Database.MySql.csproj b/tools/Beef.Database.MySql/Beef.Database.MySql.csproj index d7748bd2b..8356ce1f3 100644 --- a/tools/Beef.Database.MySql/Beef.Database.MySql.csproj +++ b/tools/Beef.Database.MySql/Beef.Database.MySql.csproj @@ -14,7 +14,7 @@ - + diff --git a/tools/Beef.Database.SqlServer/Beef.Database.SqlServer.csproj b/tools/Beef.Database.SqlServer/Beef.Database.SqlServer.csproj index 198d9209b..4696e399f 100644 --- a/tools/Beef.Database.SqlServer/Beef.Database.SqlServer.csproj +++ b/tools/Beef.Database.SqlServer/Beef.Database.SqlServer.csproj @@ -14,7 +14,7 @@ - + diff --git a/tools/Beef.Test.NUnit/Beef.Test.NUnit.csproj b/tools/Beef.Test.NUnit/Beef.Test.NUnit.csproj index 653008eb1..8c8f40725 100644 --- a/tools/Beef.Test.NUnit/Beef.Test.NUnit.csproj +++ b/tools/Beef.Test.NUnit/Beef.Test.NUnit.csproj @@ -8,7 +8,7 @@ - +