Skip to content

Commit 62f6c00

Browse files
authored
Fixes #243, #244 (#245)
1 parent f2141d6 commit 62f6c00

File tree

46 files changed

+247
-233
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+247
-233
lines changed

CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22

33
Represents the **NuGet** versions.
44

5+
## v5.12.5
6+
- *[Issue 243](https://github.com/Avanade/Beef/issues/243):* Fixed `[HttpGet("persons/{id}")]` to `[HttpGet("persons/{id}, Name=Entity-Name_Operation-Name)")]` which sets the `OperationId` within the OpenAPI output.
7+
- *[Issue 244](https://github.com/Avanade/Beef/issues/244):* Fixed `Operation.HttpAgentRoute` where specified as a query string `?foo=bar`; was being generated as `prefix/?foo=bar` versus `prefix?foo=bar`.
8+
- *Fixed:* Upgraded `CoreEx` (`v3.18.1`) to include all related fixes and improvements.
9+
510
## v5.12.4
611
- *Fixed:* Fixes to the `Template` solution to improve the initial `dotnet new beef` experience, including sample Reference Data API tests.
712
- *Fixed:* Upgraded `CoreEx` (`v3.18.0`) to include all related fixes and improvements.

Common.targets

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project>
22
<PropertyGroup>
3-
<Version>5.12.4</Version>
3+
<Version>5.12.5</Version>
44
<LangVersion>preview</LangVersion>
55
<Authors>Avanade</Authors>
66
<Company>Avanade</Company>

samples/Cdr.Banking/Cdr.Banking.Api/Cdr.Banking.Api.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<ImplicitUsings>true</ImplicitUsings>
66
</PropertyGroup>
77
<ItemGroup>
8-
<PackageReference Include="CoreEx.AspNetCore" Version="3.18.0" />
8+
<PackageReference Include="CoreEx.AspNetCore" Version="3.18.1" />
99
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerGen" Version="6.5.0" />
1010
</ItemGroup>
1111
<ItemGroup>

samples/Cdr.Banking/Cdr.Banking.Api/Controllers/Generated/AccountController.cs

+5-4
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ namespace Cdr.Banking.Api.Controllers;
88
/// Provides the <see cref="Account"/> Web API functionality.
99
/// </summary>
1010
[Tags("Banking")]
11+
[Consumes(System.Net.Mime.MediaTypeNames.Application.Json)]
1112
[Produces(System.Net.Mime.MediaTypeNames.Application.Json)]
1213
public partial class AccountController : ControllerBase
1314
{
@@ -32,7 +33,7 @@ public AccountController(WebApi webApi, IAccountManager manager)
3233
/// <param name="isOwned">Indicates whether Is Owned.</param>
3334
/// <returns>The <see cref="AccountCollection"/></returns>
3435
[Tags("Banking", "Accounts")]
35-
[HttpGet("api/v1/banking/accounts")]
36+
[HttpGet("api/v1/banking/accounts", Name="Account_GetAccounts")]
3637
[Paging]
3738
[ProducesResponseType(typeof(Common.Entities.AccountCollection), (int)HttpStatusCode.OK)]
3839
[ProducesResponseType((int)HttpStatusCode.NoContent)]
@@ -47,7 +48,7 @@ public Task<IActionResult> GetAccounts([FromQuery(Name="product-category")] stri
4748
/// </summary>
4849
/// <param name="accountId">The <see cref="Account"/> identifier.</param>
4950
/// <returns>The selected <see cref="AccountDetail"/> where found.</returns>
50-
[HttpGet("api/v1/banking/accounts/{accountId}")]
51+
[HttpGet("api/v1/banking/accounts/{accountId}", Name="Account_GetDetail")]
5152
[ProducesResponseType(typeof(Common.Entities.AccountDetail), (int)HttpStatusCode.OK)]
5253
[ProducesResponseType((int)HttpStatusCode.NotFound)]
5354
public Task<IActionResult> GetDetail(string? accountId)
@@ -58,7 +59,7 @@ public Task<IActionResult> GetDetail(string? accountId)
5859
/// </summary>
5960
/// <param name="accountId">The <see cref="Account"/> identifier.</param>
6061
/// <returns>The selected <see cref="Balance"/> where found.</returns>
61-
[HttpGet("api/v1/banking/accounts/{accountId}/balance")]
62+
[HttpGet("api/v1/banking/accounts/{accountId}/balance", Name="Account_GetBalance")]
6263
[ProducesResponseType(typeof(Common.Entities.Balance), (int)HttpStatusCode.OK)]
6364
[ProducesResponseType((int)HttpStatusCode.NotFound)]
6465
public Task<IActionResult> GetBalance(string? accountId)
@@ -69,7 +70,7 @@ public Task<IActionResult> GetBalance(string? accountId)
6970
/// </summary>
7071
/// <param name="accountId">The <see cref="Account"/> identifier.</param>
7172
/// <returns>A resultant <see cref="FileContentResult"/>.</returns>
72-
[HttpGet("api/v1/banking/accounts/{accountId}/statement")]
73+
[HttpGet("api/v1/banking/accounts/{accountId}/statement", Name="Account_GetStatement")]
7374
[Produces("text/plain")]
7475
[ProducesResponseType((int)HttpStatusCode.OK)]
7576
[ProducesResponseType((int)HttpStatusCode.NoContent)]

samples/Cdr.Banking/Cdr.Banking.Api/Controllers/Generated/ReferenceDataController.cs

+10-16
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ namespace Cdr.Banking.Api.Controllers;
99
/// <summary>
1010
/// Provides the <b>ReferenceData</b> Web API functionality.
1111
/// </summary>
12+
[Consumes(System.Net.Mime.MediaTypeNames.Application.Json)]
13+
[Produces(System.Net.Mime.MediaTypeNames.Application.Json)]
1214
public partial class ReferenceDataController : ControllerBase
1315
{
1416
private readonly ReferenceDataContentWebApi _webApi;
@@ -28,8 +30,7 @@ public ReferenceDataController(ReferenceDataContentWebApi webApi, ReferenceDataO
2830
/// <param name="codes">The reference data code list.</param>
2931
/// <param name="text">The reference data text (including wildcards).</param>
3032
/// <returns>A RefDataNamespace.OpenStatus collection.</returns>
31-
[HttpGet()]
32-
[Route("api/v1/ref/openstatuses")]
33+
[HttpGet("api/v1/ref/openstatuses", Name="ReferenceData_OpenStatusGetAll")]
3334
[ProducesResponseType(typeof(IEnumerable<CommonRefDataNamespace.OpenStatus>), (int)HttpStatusCode.OK)]
3435
public Task<IActionResult> OpenStatusGetAll([FromQuery] IEnumerable<string>? codes = default, string? text = default)
3536
=> _webApi.GetAsync(Request, p => _orchestrator.GetWithFilterAsync<RefDataNamespace.OpenStatus>(codes, text, p.RequestOptions.IncludeInactive));
@@ -40,8 +41,7 @@ public Task<IActionResult> OpenStatusGetAll([FromQuery] IEnumerable<string>? cod
4041
/// <param name="codes">The reference data code list.</param>
4142
/// <param name="text">The reference data text (including wildcards).</param>
4243
/// <returns>A RefDataNamespace.ProductCategory collection.</returns>
43-
[HttpGet()]
44-
[Route("api/v1/ref/productcategories")]
44+
[HttpGet("api/v1/ref/productcategories", Name="ReferenceData_ProductCategoryGetAll")]
4545
[ProducesResponseType(typeof(IEnumerable<CommonRefDataNamespace.ProductCategory>), (int)HttpStatusCode.OK)]
4646
public Task<IActionResult> ProductCategoryGetAll([FromQuery] IEnumerable<string>? codes = default, string? text = default)
4747
=> _webApi.GetAsync(Request, p => _orchestrator.GetWithFilterAsync<RefDataNamespace.ProductCategory>(codes, text, p.RequestOptions.IncludeInactive));
@@ -52,8 +52,7 @@ public Task<IActionResult> ProductCategoryGetAll([FromQuery] IEnumerable<string>
5252
/// <param name="codes">The reference data code list.</param>
5353
/// <param name="text">The reference data text (including wildcards).</param>
5454
/// <returns>A RefDataNamespace.AccountUType collection.</returns>
55-
[HttpGet()]
56-
[Route("api/v1/ref/accountutypes")]
55+
[HttpGet("api/v1/ref/accountutypes", Name="ReferenceData_AccountUTypeGetAll")]
5756
[ProducesResponseType(typeof(IEnumerable<CommonRefDataNamespace.AccountUType>), (int)HttpStatusCode.OK)]
5857
public Task<IActionResult> AccountUTypeGetAll([FromQuery] IEnumerable<string>? codes = default, string? text = default)
5958
=> _webApi.GetAsync(Request, p => _orchestrator.GetWithFilterAsync<RefDataNamespace.AccountUType>(codes, text, p.RequestOptions.IncludeInactive));
@@ -64,8 +63,7 @@ public Task<IActionResult> AccountUTypeGetAll([FromQuery] IEnumerable<string>? c
6463
/// <param name="codes">The reference data code list.</param>
6564
/// <param name="text">The reference data text (including wildcards).</param>
6665
/// <returns>A RefDataNamespace.MaturityInstructions collection.</returns>
67-
[HttpGet()]
68-
[Route("api/v1/ref/maturityinstructions")]
66+
[HttpGet("api/v1/ref/maturityinstructions", Name="ReferenceData_MaturityInstructionsGetAll")]
6967
[ProducesResponseType(typeof(IEnumerable<CommonRefDataNamespace.MaturityInstructions>), (int)HttpStatusCode.OK)]
7068
public Task<IActionResult> MaturityInstructionsGetAll([FromQuery] IEnumerable<string>? codes = default, string? text = default)
7169
=> _webApi.GetAsync(Request, p => _orchestrator.GetWithFilterAsync<RefDataNamespace.MaturityInstructions>(codes, text, p.RequestOptions.IncludeInactive));
@@ -76,8 +74,7 @@ public Task<IActionResult> MaturityInstructionsGetAll([FromQuery] IEnumerable<st
7674
/// <param name="codes">The reference data code list.</param>
7775
/// <param name="text">The reference data text (including wildcards).</param>
7876
/// <returns>A RefDataNamespace.TransactionType collection.</returns>
79-
[HttpGet()]
80-
[Route("api/v1/ref/transactiontypes")]
77+
[HttpGet("api/v1/ref/transactiontypes", Name="ReferenceData_TransactionTypeGetAll")]
8178
[ProducesResponseType(typeof(IEnumerable<CommonRefDataNamespace.TransactionType>), (int)HttpStatusCode.OK)]
8279
public Task<IActionResult> TransactionTypeGetAll([FromQuery] IEnumerable<string>? codes = default, string? text = default)
8380
=> _webApi.GetAsync(Request, p => _orchestrator.GetWithFilterAsync<RefDataNamespace.TransactionType>(codes, text, p.RequestOptions.IncludeInactive));
@@ -88,8 +85,7 @@ public Task<IActionResult> TransactionTypeGetAll([FromQuery] IEnumerable<string>
8885
/// <param name="codes">The reference data code list.</param>
8986
/// <param name="text">The reference data text (including wildcards).</param>
9087
/// <returns>A RefDataNamespace.TransactionStatus collection.</returns>
91-
[HttpGet()]
92-
[Route("api/v1/ref/transactionstatuses")]
88+
[HttpGet("api/v1/ref/transactionstatuses", Name="ReferenceData_TransactionStatusGetAll")]
9389
[ProducesResponseType(typeof(IEnumerable<CommonRefDataNamespace.TransactionStatus>), (int)HttpStatusCode.OK)]
9490
public Task<IActionResult> TransactionStatusGetAll([FromQuery] IEnumerable<string>? codes = default, string? text = default)
9591
=> _webApi.GetAsync(Request, p => _orchestrator.GetWithFilterAsync<RefDataNamespace.TransactionStatus>(codes, text, p.RequestOptions.IncludeInactive));
@@ -98,9 +94,7 @@ public Task<IActionResult> TransactionStatusGetAll([FromQuery] IEnumerable<strin
9894
/// 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
9995
/// </summary>
10096
/// <returns>A <see cref="ReferenceDataMultiDictionary"/>.</returns>
101-
[HttpGet()]
102-
[Route("api/v1/ref")]
103-
[ProducesResponseType(typeof(IEnumerable<CoreEx.RefData.ReferenceDataMultiDictionary>), (int)HttpStatusCode.OK)]
104-
[ApiExplorerSettings(IgnoreApi = true)]
97+
[HttpGet("api/v1/ref", Name="ReferenceData_GetNamed")]
98+
[ProducesResponseType(typeof(CoreEx.RefData.ReferenceDataMultiDictionary), (int)HttpStatusCode.OK)]
10599
public Task<IActionResult> GetNamed() => _webApi.GetAsync(Request, p => _orchestrator.GetNamedAsync(p.RequestOptions));
106100
}

samples/Cdr.Banking/Cdr.Banking.Api/Controllers/Generated/TransactionController.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ namespace Cdr.Banking.Api.Controllers;
77
/// <summary>
88
/// Provides the <see cref="Transaction"/> Web API functionality.
99
/// </summary>
10+
[Consumes(System.Net.Mime.MediaTypeNames.Application.Json)]
1011
[Produces(System.Net.Mime.MediaTypeNames.Application.Json)]
1112
public partial class TransactionController : ControllerBase
1213
{
@@ -33,7 +34,7 @@ public TransactionController(WebApi webApi, ITransactionManager manager)
3334
/// <param name="maxAmount">The Max Amount.</param>
3435
/// <param name="text">The Text.</param>
3536
/// <returns>The <see cref="TransactionCollection"/></returns>
36-
[HttpGet("api/v1/banking/accounts/{accountId}/transactions")]
37+
[HttpGet("api/v1/banking/accounts/{accountId}/transactions", Name="Transaction_GetTransactions")]
3738
[Paging]
3839
[ProducesResponseType(typeof(Common.Entities.TransactionCollection), (int)HttpStatusCode.OK)]
3940
[ProducesResponseType((int)HttpStatusCode.NoContent)]

samples/Cdr.Banking/Cdr.Banking.Business/Cdr.Banking.Business.csproj

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
<Folder Include="DataSvc\" />
1212
</ItemGroup>
1313
<ItemGroup>
14-
<PackageReference Include="CoreEx.AspNetCore" Version="3.18.0" />
15-
<PackageReference Include="CoreEx.Cosmos" Version="3.18.0" />
16-
<PackageReference Include="CoreEx.Validation" Version="3.18.0" />
14+
<PackageReference Include="CoreEx.AspNetCore" Version="3.18.1" />
15+
<PackageReference Include="CoreEx.Cosmos" Version="3.18.1" />
16+
<PackageReference Include="CoreEx.Validation" Version="3.18.1" />
1717
</ItemGroup>
1818
</Project>

samples/Cdr.Banking/Cdr.Banking.Common/Cdr.Banking.Common.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@
88
<Folder Include="Entities\" />
99
</ItemGroup>
1010
<ItemGroup>
11-
<PackageReference Include="CoreEx" Version="3.18.0" />
11+
<PackageReference Include="CoreEx" Version="3.18.1" />
1212
</ItemGroup>
1313
</Project>

samples/Cdr.Banking/Cdr.Banking.Test/Cdr.Banking.Test.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
4040
</PackageReference>
4141
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
42-
<PackageReference Include="CoreEx.UnitTesting.NUnit" Version="3.18.0" />
42+
<PackageReference Include="CoreEx.UnitTesting.NUnit" Version="3.18.1" />
4343
</ItemGroup>
4444

4545
<ItemGroup>

samples/Demo/Beef.Demo.Api/Beef.Demo.Api.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
</PropertyGroup>
1313

1414
<ItemGroup>
15-
<PackageReference Include="CoreEx.AspNetCore" Version="3.18.0" />
15+
<PackageReference Include="CoreEx.AspNetCore" Version="3.18.1" />
1616
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.5.0" />
1717
<PackageReference Include="Swashbuckle.AspNetCore.Newtonsoft" Version="6.5.0" />
1818
</ItemGroup>

samples/Demo/Beef.Demo.Api/Controllers/Generated/ConfigController.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ namespace Beef.Demo.Api.Controllers;
1010
/// <summary>
1111
/// Provides the <b>Config</b> Web API functionality.
1212
/// </summary>
13+
[Consumes(System.Net.Mime.MediaTypeNames.Application.Json)]
1314
[Produces(System.Net.Mime.MediaTypeNames.Application.Json)]
1415
public partial class ConfigController : ControllerBase
1516
{
@@ -30,7 +31,7 @@ public ConfigController(WebApi webApi, IConfigManager manager)
3031
/// Get Env Vars.
3132
/// </summary>
3233
/// <returns>A resultant <see cref="System.Collections.IDictionary"/>.</returns>
33-
[HttpPost("api/v1/envvars")]
34+
[HttpPost("api/v1/envvars", Name="Config_GetEnvVars")]
3435
[ProducesResponseType(typeof(System.Collections.IDictionary), (int)HttpStatusCode.OK)]
3536
[ProducesResponseType((int)HttpStatusCode.NoContent)]
3637
public Task<IActionResult> GetEnvVars()

samples/Demo/Beef.Demo.Api/Controllers/Generated/ContactController.cs

+10-7
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ namespace Beef.Demo.Api.Controllers;
1111
/// Provides the <see cref="Contact"/> Web API functionality.
1212
/// </summary>
1313
[AllowAnonymous]
14+
[Consumes(System.Net.Mime.MediaTypeNames.Application.Json)]
1415
[Produces(System.Net.Mime.MediaTypeNames.Application.Json)]
1516
public partial class ContactController : ControllerBase
1617
{
@@ -33,7 +34,7 @@ public ContactController(WebApi webApi, IContactManager manager, Microsoft.Exten
3334
/// Gets the <see cref="ContactCollectionResult"/> that contains the items that match the selection criteria.
3435
/// </summary>
3536
/// <returns>The <see cref="ContactCollection"/></returns>
36-
[HttpGet("api/v1/contacts")]
37+
[HttpGet("api/v1/contacts", Name="Contact_GetAll")]
3738
[ProducesResponseType(typeof(Common.Entities.ContactCollection), (int)HttpStatusCode.OK)]
3839
[ProducesResponseType((int)HttpStatusCode.NoContent)]
3940
public Task<IActionResult> GetAll()
@@ -44,7 +45,7 @@ public Task<IActionResult> GetAll()
4445
/// </summary>
4546
/// <param name="id">The <see cref="Contact"/> identifier.</param>
4647
/// <returns>The selected <see cref="Contact"/> where found.</returns>
47-
[HttpGet("api/v1/contacts/{id}")]
48+
[HttpGet("api/v1/contacts/{id}", Name="Contact_Get")]
4849
[ProducesResponseType(typeof(Common.Entities.Contact), (int)HttpStatusCode.OK)]
4950
[ProducesResponseType((int)HttpStatusCode.NotFound)]
5051
public Task<IActionResult> Get(Guid id)
@@ -54,7 +55,7 @@ public Task<IActionResult> Get(Guid id)
5455
/// Creates a new <see cref="Contact"/>.
5556
/// </summary>
5657
/// <returns>The created <see cref="Contact"/>.</returns>
57-
[HttpPost("api/v1/contacts")]
58+
[HttpPost("api/v1/contacts", Name="Contact_Create")]
5859
[AcceptsBody(typeof(Common.Entities.Contact))]
5960
[ProducesResponseType(typeof(Common.Entities.Contact), (int)HttpStatusCode.Created)]
6061
public Task<IActionResult> Create()
@@ -65,9 +66,10 @@ public Task<IActionResult> Create()
6566
/// </summary>
6667
/// <param name="id">The <see cref="Contact"/> identifier.</param>
6768
/// <returns>The updated <see cref="Contact"/>.</returns>
68-
[HttpPut("api/v1/contacts/{id}")]
69+
[HttpPut("api/v1/contacts/{id}", Name="Contact_Update")]
6970
[AcceptsBody(typeof(Common.Entities.Contact))]
7071
[ProducesResponseType(typeof(Common.Entities.Contact), (int)HttpStatusCode.OK)]
72+
[ProducesResponseType((int)HttpStatusCode.NotFound)]
7173
public Task<IActionResult> Update(Guid id)
7274
=> _webApi.PutAsync<Contact, Contact>(Request, p => _manager.UpdateAsync(p.Value!, id));
7375

@@ -76,17 +78,18 @@ public Task<IActionResult> Update(Guid id)
7678
/// </summary>
7779
/// <param name="id">The <see cref="Contact"/> identifier.</param>
7880
/// <returns>The patched <see cref="Contact"/>.</returns>
79-
[HttpPatch("api/v1/contacts/{id}")]
81+
[HttpPatch("api/v1/contacts/{id}", Name="Contact_Patch")]
8082
[AcceptsBody(typeof(Common.Entities.Contact), HttpConsts.MergePatchMediaTypeName)]
8183
[ProducesResponseType(typeof(Common.Entities.Contact), (int)HttpStatusCode.OK)]
84+
[ProducesResponseType((int)HttpStatusCode.NotFound)]
8285
public Task<IActionResult> Patch(Guid id)
8386
=> _webApi.PatchAsync<Contact>(Request, get: _ => _manager.GetAsync(id), put: p => _manager.UpdateAsync(p.Value!, id));
8487

8588
/// <summary>
8689
/// Deletes the specified <see cref="Contact"/>.
8790
/// </summary>
8891
/// <param name="id">The <see cref="Contact"/> identifier.</param>
89-
[HttpDelete("api/v1/contacts/{id}")]
92+
[HttpDelete("api/v1/contacts/{id}", Name="Contact_Delete")]
9093
[ProducesResponseType((int)HttpStatusCode.NoContent)]
9194
public Task<IActionResult> Delete(Guid id)
9295
=> _webApi.DeleteAsync(Request, p => _manager.DeleteAsync(id));
@@ -95,7 +98,7 @@ public Task<IActionResult> Delete(Guid id)
9598
/// Raise Event.
9699
/// </summary>
97100
/// <param name="throwError">Indicates whether throw a DivideByZero exception.</param>
98-
[HttpPost("api/v1/contacts/raise")]
101+
[HttpPost("api/v1/contacts/raise", Name="Contact_RaiseEvent")]
99102
[ProducesResponseType((int)HttpStatusCode.NoContent)]
100103
public Task<IActionResult> RaiseEvent(bool throwError)
101104
=> _webApi.PostAsync(Request, p => _manager.RaiseEventAsync(throwError), statusCode: HttpStatusCode.NoContent, operationType: CoreEx.OperationType.Unspecified);

samples/Demo/Beef.Demo.Api/Controllers/Generated/GenderController.cs

+5-3
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ namespace Beef.Demo.Api.Controllers;
1111
/// Provides the <see cref="Gender"/> Web API functionality.
1212
/// </summary>
1313
[AllowAnonymous]
14+
[Consumes(System.Net.Mime.MediaTypeNames.Application.Json)]
1415
[Produces(System.Net.Mime.MediaTypeNames.Application.Json)]
1516
public partial class GenderController : ControllerBase
1617
{
@@ -32,7 +33,7 @@ public GenderController(ReferenceDataContentWebApi webApi, IGenderManager manage
3233
/// </summary>
3334
/// <param name="id">The <see cref="Gender"/> identifier.</param>
3435
/// <returns>The selected <see cref="Gender"/> where found.</returns>
35-
[HttpGet("api/v1/demo/ref/genders/{id}")]
36+
[HttpGet("api/v1/demo/ref/genders/{id}", Name="Gender_Get")]
3637
[ProducesResponseType(typeof(Common.Entities.Gender), (int)HttpStatusCode.OK)]
3738
[ProducesResponseType((int)HttpStatusCode.NotFound)]
3839
public Task<IActionResult> Get(Guid id)
@@ -42,7 +43,7 @@ public Task<IActionResult> Get(Guid id)
4243
/// Creates a new <see cref="Gender"/>.
4344
/// </summary>
4445
/// <returns>The created <see cref="Gender"/>.</returns>
45-
[HttpPost("api/v1/demo/ref/genders")]
46+
[HttpPost("api/v1/demo/ref/genders", Name="Gender_Create")]
4647
[AcceptsBody(typeof(Common.Entities.Gender))]
4748
[ProducesResponseType(typeof(Common.Entities.Gender), (int)HttpStatusCode.Created)]
4849
public Task<IActionResult> Create()
@@ -53,9 +54,10 @@ public Task<IActionResult> Create()
5354
/// </summary>
5455
/// <param name="id">The <see cref="Gender"/> identifier.</param>
5556
/// <returns>The updated <see cref="Gender"/>.</returns>
56-
[HttpPut("api/v1/demo/ref/genders/{id}")]
57+
[HttpPut("api/v1/demo/ref/genders/{id}", Name="Gender_Update")]
5758
[AcceptsBody(typeof(Common.Entities.Gender))]
5859
[ProducesResponseType(typeof(Common.Entities.Gender), (int)HttpStatusCode.OK)]
60+
[ProducesResponseType((int)HttpStatusCode.NotFound)]
5961
public Task<IActionResult> Update(Guid id)
6062
=> _webApi.PutWithResultAsync<Gender, Gender>(Request, p => _manager.UpdateAsync(p.Value!, id));
6163
}

0 commit comments

Comments
 (0)