Skip to content

Commit

Permalink
Fix RefData GetNamed (#233)
Browse files Browse the repository at this point in the history
  • Loading branch information
chullybun authored Dec 22, 2023
1 parent cdb58c7 commit add6bd9
Show file tree
Hide file tree
Showing 39 changed files with 132 additions and 320 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion Common.targets
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<Version>5.7.3</Version>
<Version>5.7.4</Version>
<LangVersion>preview</LangVersion>
<Authors>Avanade</Authors>
<Company>Avanade</Company>
Expand Down
2 changes: 1 addition & 1 deletion samples/Cdr.Banking/Cdr.Banking.Api/Cdr.Banking.Api.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<ImplicitUsings>true</ImplicitUsings>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="CoreEx.AspNetCore" Version="3.7.0" />
<PackageReference Include="CoreEx.AspNetCore" Version="3.7.2" />
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerGen" Version="6.5.0" />
</ItemGroup>
<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,10 @@ public Task<IActionResult> TransactionStatusGetAll([FromQuery] IEnumerable<strin
/// <summary>
/// Gets the reference data entries for the specified entities and codes from the query string; e.g: api/v1/ref?entity=codeX,codeY&amp;entity2=codeZ&amp;entity3
/// </summary>
/// <returns>A <see cref="ReferenceDataMultiCollection"/>.</returns>
/// <returns>A <see cref="ReferenceDataMultiDictionary"/>.</returns>
[HttpGet()]
[Route("api/v1/ref")]
[ProducesResponseType(typeof(IEnumerable<CoreEx.RefData.ReferenceDataMultiItem>), (int)HttpStatusCode.OK)]
[ProducesResponseType(typeof(IEnumerable<CoreEx.RefData.ReferenceDataMultiDictionary>), (int)HttpStatusCode.OK)]
[ApiExplorerSettings(IgnoreApi = true)]
public Task<IActionResult> GetNamed() => _webApi.GetAsync(Request, p => _orchestrator.GetNamedAsync(p.RequestOptions));
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<Folder Include="DataSvc\" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="CoreEx.Cosmos" Version="3.7.0" />
<PackageReference Include="CoreEx.Validation" Version="3.7.0" />
<PackageReference Include="CoreEx.Cosmos" Version="3.7.2" />
<PackageReference Include="CoreEx.Validation" Version="3.7.2" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -34,74 +34,31 @@ public partial class ReferenceDataAgent : TypedHttpClientBase<ReferenceDataAgent
public ReferenceDataAgent(HttpClient client, IJsonSerializer jsonSerializer, CoreEx.ExecutionContext executionContext, SettingsBase settings, ILogger<ReferenceDataAgent> logger)
: base(client, jsonSerializer, executionContext, settings, logger) { }

/// <summary>
/// Gets all of the <see cref="RefDataNamespace.OpenStatus"/> items that match the filter arguments.
/// </summary>
/// <param name="args">The optional <see cref="ReferenceDataFilter"/> arguments.</param>
/// <param name="requestOptions">The optional <see cref="HttpRequestOptions"/>.</param>
/// <param name="cancellationToken">The <see cref="CancellationToken"/>.</param>
/// <returns>A <see cref="HttpResult"/>.</returns>
/// <inheritdoc/>
public Task<HttpResult<RefDataNamespace.OpenStatusCollection>> OpenStatusGetAllAsync(ReferenceDataFilter? args = null, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) =>
GetAsync<RefDataNamespace.OpenStatusCollection>("api/v1/ref/openstatuses", requestOptions: requestOptions, args: HttpArgs.Create(new HttpArg<ReferenceDataFilter>("args", args!, HttpArgType.FromUriUseProperties)), cancellationToken);

/// <summary>
/// Gets all of the <see cref="RefDataNamespace.ProductCategory"/> items that match the filter arguments.
/// </summary>
/// <param name="args">The optional <see cref="ReferenceDataFilter"/> arguments.</param>
/// <param name="requestOptions">The optional <see cref="HttpRequestOptions"/>.</param>
/// <param name="cancellationToken">The <see cref="CancellationToken"/>.</param>
/// <returns>A <see cref="HttpResult"/>.</returns>
/// <inheritdoc/>
public Task<HttpResult<RefDataNamespace.ProductCategoryCollection>> ProductCategoryGetAllAsync(ReferenceDataFilter? args = null, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) =>
GetAsync<RefDataNamespace.ProductCategoryCollection>("api/v1/ref/productcategories", requestOptions: requestOptions, args: HttpArgs.Create(new HttpArg<ReferenceDataFilter>("args", args!, HttpArgType.FromUriUseProperties)), cancellationToken);

/// <summary>
/// Gets all of the <see cref="RefDataNamespace.AccountUType"/> items that match the filter arguments.
/// </summary>
/// <param name="args">The optional <see cref="ReferenceDataFilter"/> arguments.</param>
/// <param name="requestOptions">The optional <see cref="HttpRequestOptions"/>.</param>
/// <param name="cancellationToken">The <see cref="CancellationToken"/>.</param>
/// <returns>A <see cref="HttpResult"/>.</returns>
/// <inheritdoc/>
public Task<HttpResult<RefDataNamespace.AccountUTypeCollection>> AccountUTypeGetAllAsync(ReferenceDataFilter? args = null, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) =>
GetAsync<RefDataNamespace.AccountUTypeCollection>("api/v1/ref/accountutypes", requestOptions: requestOptions, args: HttpArgs.Create(new HttpArg<ReferenceDataFilter>("args", args!, HttpArgType.FromUriUseProperties)), cancellationToken);

/// <summary>
/// Gets all of the <see cref="RefDataNamespace.MaturityInstructions"/> items that match the filter arguments.
/// </summary>
/// <param name="args">The optional <see cref="ReferenceDataFilter"/> arguments.</param>
/// <param name="requestOptions">The optional <see cref="HttpRequestOptions"/>.</param>
/// <param name="cancellationToken">The <see cref="CancellationToken"/>.</param>
/// <returns>A <see cref="HttpResult"/>.</returns>
/// <inheritdoc/>
public Task<HttpResult<RefDataNamespace.MaturityInstructionsCollection>> MaturityInstructionsGetAllAsync(ReferenceDataFilter? args = null, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) =>
GetAsync<RefDataNamespace.MaturityInstructionsCollection>("api/v1/ref/maturityinstructions", requestOptions: requestOptions, args: HttpArgs.Create(new HttpArg<ReferenceDataFilter>("args", args!, HttpArgType.FromUriUseProperties)), cancellationToken);

/// <summary>
/// Gets all of the <see cref="RefDataNamespace.TransactionType"/> items that match the filter arguments.
/// </summary>
/// <param name="args">The optional <see cref="ReferenceDataFilter"/> arguments.</param>
/// <param name="requestOptions">The optional <see cref="HttpRequestOptions"/>.</param>
/// <param name="cancellationToken">The <see cref="CancellationToken"/>.</param>
/// <returns>A <see cref="HttpResult"/>.</returns>
/// <inheritdoc/>
public Task<HttpResult<RefDataNamespace.TransactionTypeCollection>> TransactionTypeGetAllAsync(ReferenceDataFilter? args = null, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) =>
GetAsync<RefDataNamespace.TransactionTypeCollection>("api/v1/ref/transactiontypes", requestOptions: requestOptions, args: HttpArgs.Create(new HttpArg<ReferenceDataFilter>("args", args!, HttpArgType.FromUriUseProperties)), cancellationToken);

/// <summary>
/// Gets all of the <see cref="RefDataNamespace.TransactionStatus"/> items that match the filter arguments.
/// </summary>
/// <param name="args">The optional <see cref="ReferenceDataFilter"/> arguments.</param>
/// <param name="requestOptions">The optional <see cref="HttpRequestOptions"/>.</param>
/// <param name="cancellationToken">The <see cref="CancellationToken"/>.</param>
/// <returns>A <see cref="HttpResult"/>.</returns>
/// <inheritdoc/>
public Task<HttpResult<RefDataNamespace.TransactionStatusCollection>> TransactionStatusGetAllAsync(ReferenceDataFilter? args = null, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) =>
GetAsync<RefDataNamespace.TransactionStatusCollection>("api/v1/ref/transactionstatuses", requestOptions: requestOptions, args: HttpArgs.Create(new HttpArg<ReferenceDataFilter>("args", args!, HttpArgType.FromUriUseProperties)), cancellationToken);

/// <summary>
/// Gets the reference data entries for the specified entities and codes from the query string; e.g: api/v1/ref?entity=codeX,codeY&amp;entity2=codeZ&amp;entity3
/// </summary>
/// <param name="names">The optional list of reference data names.</param>
/// <param name="requestOptions">The optional <see cref="HttpRequestOptions"/>.</param>
/// <param name="cancellationToken">The <see cref="CancellationToken"/>.</param>
/// <returns>A <see cref="HttpResult"/>.</returns>
/// <remarks>The reference data objects will need to be manually extracted from the corresponding response content.</remarks>
/// <inheritdoc/>
public Task<HttpResult> GetNamedAsync(string[] names, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default)
{
var ro = requestOptions ?? new HttpRequestOptions();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
<Folder Include="Entities\" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="CoreEx" Version="3.7.0" />
<PackageReference Include="CoreEx" Version="3.7.2" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="CoreEx.UnitTesting.NUnit" Version="3.7.0" />
<PackageReference Include="CoreEx.UnitTesting.NUnit" Version="3.7.2" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion samples/Demo/Beef.Demo.Api/Beef.Demo.Api.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="CoreEx.AspNetCore" Version="3.7.0" />
<PackageReference Include="CoreEx.AspNetCore" Version="3.7.2" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.5.0" />
<PackageReference Include="Swashbuckle.AspNetCore.Newtonsoft" Version="6.5.0" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,11 +133,11 @@ public Task<IActionResult> CommunicationTypeGetAll([FromQuery] IEnumerable<strin
/// <summary>
/// Gets the reference data entries for the specified entities and codes from the query string; e.g: api/v1/demo/ref?entity=codeX,codeY&amp;entity2=codeZ&amp;entity3
/// </summary>
/// <returns>A <see cref="ReferenceDataMultiCollection"/>.</returns>
/// <returns>A <see cref="ReferenceDataMultiDictionary"/>.</returns>
[AllowAnonymous]
[HttpGet()]
[Route("api/v1/demo/ref")]
[ProducesResponseType(typeof(IEnumerable<CoreEx.RefData.ReferenceDataMultiItem>), (int)HttpStatusCode.OK)]
[ProducesResponseType(typeof(IEnumerable<CoreEx.RefData.ReferenceDataMultiDictionary>), (int)HttpStatusCode.OK)]
[ApiExplorerSettings(IgnoreApi = true)]
public Task<IActionResult> GetNamed() => _webApi.GetAsync(Request, p => _orchestrator.GetNamedAsync(p.RequestOptions));
}
Expand Down
14 changes: 7 additions & 7 deletions samples/Demo/Beef.Demo.Business/Beef.Demo.Business.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="CoreEx" Version="3.7.0" />
<PackageReference Include="CoreEx.Cosmos" Version="3.7.0" />
<PackageReference Include="CoreEx.Database" Version="3.7.0" />
<PackageReference Include="CoreEx.Database.SqlServer" Version="3.7.0" />
<PackageReference Include="CoreEx.EntityFrameworkCore" Version="3.7.0" />
<PackageReference Include="CoreEx.Validation" Version="3.7.0" />
<PackageReference Include="CoreEx.FluentValidation" Version="3.7.0" />
<PackageReference Include="CoreEx" Version="3.7.2" />
<PackageReference Include="CoreEx.Cosmos" Version="3.7.2" />
<PackageReference Include="CoreEx.Database" Version="3.7.2" />
<PackageReference Include="CoreEx.Database.SqlServer" Version="3.7.2" />
<PackageReference Include="CoreEx.EntityFrameworkCore" Version="3.7.2" />
<PackageReference Include="CoreEx.Validation" Version="3.7.2" />
<PackageReference Include="CoreEx.FluentValidation" Version="3.7.2" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="6.0.20" />
</ItemGroup>

Expand Down
Loading

0 comments on commit add6bd9

Please sign in to comment.