From 1ee170a6f434366c51a42443d1b6487b4be6eb75 Mon Sep 17 00:00:00 2001 From: chullybun Date: Wed, 23 Oct 2024 11:20:26 -0700 Subject: [PATCH] Agent code-gen simplification. --- CHANGELOG.md | 1 + .../Cdr.Banking.Api/Cdr.Banking.Api.csproj | 2 +- .../Cdr.Banking.Business.csproj | 6 +- .../Agents/Generated/AccountAgent.cs | 23 +++--- .../Agents/Generated/ReferenceDataAgent.cs | 25 +++---- .../Agents/Generated/TransactionAgent.cs | 15 ++-- .../Cdr.Banking.Common.csproj | 2 +- .../Cdr.Banking.Test/Cdr.Banking.Test.csproj | 2 +- .../Demo/Beef.Demo.Api/Beef.Demo.Api.csproj | 2 +- .../Beef.Demo.Business.csproj | 16 ++-- .../Beef.Demo.Business/Data/PersonData.cs | 1 + .../Agents/Generated/ConfigAgent.cs | 13 +--- .../Agents/Generated/ContactAgent.cs | 27 +++---- .../Agents/Generated/GenderAgent.cs | 19 ++--- .../Agents/Generated/PersonAgent.cs | 75 +++++++++---------- .../Agents/Generated/PostalInfoAgent.cs | 23 +++--- .../Agents/Generated/ReferenceDataAgent.cs | 29 +++---- .../Agents/Generated/RobotAgent.cs | 27 +++---- .../Beef.Demo.Common/Beef.Demo.Common.csproj | 2 +- .../Demo/Beef.Demo.Test/Beef.Demo.Test.csproj | 2 +- samples/Demo/Beef.Demo.Test/PersonTest.cs | 11 ++- samples/My.Hr/My.Hr.Api/My.Hr.Api.csproj | 2 +- .../My.Hr.Business/My.Hr.Business.csproj | 8 +- .../Agents/Generated/EmployeeAgent.cs | 27 +++---- .../Generated/PerformanceReviewAgent.cs | 25 +++---- .../Agents/Generated/ReferenceDataAgent.cs | 23 +++--- .../My.Hr/My.Hr.Common/My.Hr.Common.csproj | 2 +- samples/My.Hr/My.Hr.Test/My.Hr.Test.csproj | 4 +- .../MyEf.Hr/MyEf.Hr.Api/MyEf.Hr.Api.csproj | 4 +- .../MyEf.Hr.Business/MyEf.Hr.Business.csproj | 8 +- .../Agents/Generated/EmployeeAgent.cs | 29 +++---- .../Generated/PerformanceReviewAgent.cs | 25 +++---- .../Agents/Generated/ReferenceDataAgent.cs | 23 +++--- .../MyEf.Hr.Common/MyEf.Hr.Common.csproj | 2 +- .../MyEf.Hr.Security.Subscriptions.csproj | 4 +- .../OktaHttpClient.cs | 7 +- .../MyEf.Hr.Security.Subscriptions/Startup.cs | 6 +- .../MyEf.Hr.Security.Test.csproj | 2 +- .../MyEf.Hr/MyEf.Hr.Test/MyEf.Hr.Test.csproj | 4 +- .../MyEf.Hr/docs/10-Service-Bus-Subscribe.md | 13 ++-- .../content/.template.config/template.json | 2 +- .../Templates/EntityWebApiAgent_cs.hbs | 16 ++-- .../Templates/ReferenceDataWebApiAgent_cs.hbs | 15 ++-- .../Beef.Database.Core.csproj | 2 +- .../Beef.Database.MySql.csproj | 2 +- .../Beef.Database.Postgres.csproj | 2 +- .../Beef.Database.SqlServer.csproj | 2 +- tools/Beef.Test.NUnit/Beef.Test.NUnit.csproj | 2 +- 48 files changed, 252 insertions(+), 332 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 05acb6c9..c15e559c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ Represents the **NuGet** versions. ## v5.17.1 - *Fixed:* The database console `Script` command execution has been updated to output to the correct directory path. +- *Fixed:* The `Agent` code-generation artefacts have been further simplified/improved. ## v5.17.0 - *Enhancement:* The `Common`-project related code-generated artefacts have all been updated to leverage `global using` and file scoped namespace declarations. 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 e7338b6f..bd88762f 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.Business/Cdr.Banking.Business.csproj b/samples/Cdr.Banking/Cdr.Banking.Business/Cdr.Banking.Business.csproj index ffda0712..f5ee3356 100644 --- a/samples/Cdr.Banking/Cdr.Banking.Business/Cdr.Banking.Business.csproj +++ b/samples/Cdr.Banking/Cdr.Banking.Business/Cdr.Banking.Business.csproj @@ -12,8 +12,8 @@ - - - + + + \ No newline at end of file diff --git a/samples/Cdr.Banking/Cdr.Banking.Common/Agents/Generated/AccountAgent.cs b/samples/Cdr.Banking/Cdr.Banking.Common/Agents/Generated/AccountAgent.cs index 454c9cd0..59cb9cb7 100644 --- a/samples/Cdr.Banking/Cdr.Banking.Common/Agents/Generated/AccountAgent.cs +++ b/samples/Cdr.Banking/Cdr.Banking.Common/Agents/Generated/AccountAgent.cs @@ -7,33 +7,28 @@ namespace Cdr.Banking.Common.Agents; /// /// Provides the HTTP agent. /// -public partial class AccountAgent : TypedHttpClientBase, IAccountAgent +/// The underlying . +/// The optional . +/// The optional . +public partial class AccountAgent(HttpClient client, IJsonSerializer? jsonSerializer = null, CoreEx.ExecutionContext? executionContext = null) : TypedHttpClientBase(client, jsonSerializer, executionContext), IAccountAgent { - /// - /// Initializes a new instance of the class. - /// - /// The underlying . - /// The optional . - /// The optional . - public AccountAgent(HttpClient client, IJsonSerializer? jsonSerializer = null, CoreEx.ExecutionContext? executionContext = null) : base(client, jsonSerializer, executionContext) { } - /// public Task> GetAccountsAsync(AccountArgs? args, PagingArgs? paging = null, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) - => GetAsync("api/v1/banking/accounts", requestOptions: requestOptions.IncludePaging(paging), args: HttpArgs.Create(new HttpArg("args", args, HttpArgType.FromUriUseProperties)), cancellationToken: cancellationToken); + => GetAsync("api/v1/banking/accounts", requestOptions.IncludePaging(paging), [new HttpArg("args", args, HttpArgType.FromUriUseProperties)], cancellationToken); /// public Task> GetAccountsQueryAsync(QueryArgs? query = null, PagingArgs? paging = null, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) - => GetAsync("api/v1/banking/accounts/query", requestOptions: requestOptions.IncludeQuery(query).IncludePaging(paging), args: HttpArgs.Create(), cancellationToken: cancellationToken); + => GetAsync("api/v1/banking/accounts/query", requestOptions: requestOptions.IncludeQuery(query).IncludePaging(paging), cancellationToken: cancellationToken); /// public Task> GetDetailAsync(string? accountId, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) - => GetAsync("api/v1/banking/accounts/{accountId}", requestOptions: requestOptions, args: HttpArgs.Create(new HttpArg("accountId", accountId)), cancellationToken: cancellationToken); + => GetAsync("api/v1/banking/accounts/{accountId}", requestOptions, [new HttpArg("accountId", accountId)], cancellationToken); /// public Task> GetBalanceAsync(string? accountId, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) - => GetAsync("api/v1/banking/accounts/{accountId}/balance", requestOptions: requestOptions, args: HttpArgs.Create(new HttpArg("accountId", accountId)), cancellationToken: cancellationToken); + => GetAsync("api/v1/banking/accounts/{accountId}/balance", requestOptions, [new HttpArg("accountId", accountId)], cancellationToken); /// public Task GetStatementAsync(string? accountId, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) - => GetAsync("api/v1/banking/accounts/{accountId}/statement", requestOptions: requestOptions, args: HttpArgs.Create(new HttpArg("accountId", accountId)), cancellationToken: cancellationToken); + => GetAsync("api/v1/banking/accounts/{accountId}/statement", requestOptions, [new HttpArg("accountId", accountId)], cancellationToken); } \ 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 877fb7d7..e3f49150 100644 --- a/samples/Cdr.Banking/Cdr.Banking.Common/Agents/Generated/ReferenceDataAgent.cs +++ b/samples/Cdr.Banking/Cdr.Banking.Common/Agents/Generated/ReferenceDataAgent.cs @@ -7,39 +7,34 @@ namespace Cdr.Banking.Common.Agents; /// /// Provides the ReferenceData HTTP agent. /// -public partial class ReferenceDataAgent : TypedHttpClientBase, IReferenceDataAgent +/// The underlying . +/// The optional . +/// The optional . +public partial class ReferenceDataAgent(HttpClient client, IJsonSerializer? jsonSerializer = null, CoreEx.ExecutionContext? executionContext = null) : TypedHttpClientBase(client, jsonSerializer, executionContext), IReferenceDataAgent { - /// - /// Initializes a new instance of the class. - /// - /// The underlying . - /// The optional . - /// The optional . - public ReferenceDataAgent(HttpClient client, IJsonSerializer? jsonSerializer = null, CoreEx.ExecutionContext? executionContext = null) : base(client, jsonSerializer, executionContext) { } - /// 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); + => GetAsync("api/v1/ref/openstatuses", requestOptions, [new HttpArg("args", args, HttpArgType.FromUriUseProperties)], cancellationToken); /// 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); + => GetAsync("api/v1/ref/productcategories", requestOptions, [new HttpArg("args", args, HttpArgType.FromUriUseProperties)], cancellationToken); /// 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); + => GetAsync("api/v1/ref/accountutypes", requestOptions, [new HttpArg("args", args, HttpArgType.FromUriUseProperties)], cancellationToken); /// 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); + => GetAsync("api/v1/ref/maturityinstructions", requestOptions, [new HttpArg("args", args, HttpArgType.FromUriUseProperties)], cancellationToken); /// 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); + => GetAsync("api/v1/ref/transactiontypes", requestOptions, [new HttpArg("args", args, HttpArgType.FromUriUseProperties)], cancellationToken); /// 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); + => GetAsync("api/v1/ref/transactionstatuses", requestOptions, [new HttpArg("args", args, HttpArgType.FromUriUseProperties)], cancellationToken); /// public Task GetNamedAsync(string[] names, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) diff --git a/samples/Cdr.Banking/Cdr.Banking.Common/Agents/Generated/TransactionAgent.cs b/samples/Cdr.Banking/Cdr.Banking.Common/Agents/Generated/TransactionAgent.cs index 2b21ac33..c6bbe997 100644 --- a/samples/Cdr.Banking/Cdr.Banking.Common/Agents/Generated/TransactionAgent.cs +++ b/samples/Cdr.Banking/Cdr.Banking.Common/Agents/Generated/TransactionAgent.cs @@ -7,17 +7,12 @@ namespace Cdr.Banking.Common.Agents; /// /// Provides the HTTP agent. /// -public partial class TransactionAgent : TypedHttpClientBase, ITransactionAgent +/// The underlying . +/// The optional . +/// The optional . +public partial class TransactionAgent(HttpClient client, IJsonSerializer? jsonSerializer = null, CoreEx.ExecutionContext? executionContext = null) : TypedHttpClientBase(client, jsonSerializer, executionContext), ITransactionAgent { - /// - /// Initializes a new instance of the class. - /// - /// The underlying . - /// The optional . - /// The optional . - public TransactionAgent(HttpClient client, IJsonSerializer? jsonSerializer = null, CoreEx.ExecutionContext? executionContext = null) : base(client, jsonSerializer, executionContext) { } - /// public Task> GetTransactionsAsync(string? accountId, TransactionArgs? args, PagingArgs? paging = null, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) - => GetAsync("api/v1/banking/accounts/{accountId}/transactions", requestOptions: requestOptions.IncludePaging(paging), args: HttpArgs.Create(new HttpArg("accountId", accountId), new HttpArg("args", args, HttpArgType.FromUriUseProperties)), cancellationToken: cancellationToken); + => GetAsync("api/v1/banking/accounts/{accountId}/transactions", requestOptions.IncludePaging(paging), [new HttpArg("accountId", accountId), new HttpArg("args", args, HttpArgType.FromUriUseProperties)], cancellationToken); } \ No newline at end of file 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 81a2a702..d1ff3b43 100644 --- a/samples/Cdr.Banking/Cdr.Banking.Common/Cdr.Banking.Common.csproj +++ b/samples/Cdr.Banking/Cdr.Banking.Common/Cdr.Banking.Common.csproj @@ -10,6 +10,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 50b5238b..be08da64 100644 --- a/samples/Cdr.Banking/Cdr.Banking.Test/Cdr.Banking.Test.csproj +++ b/samples/Cdr.Banking/Cdr.Banking.Test/Cdr.Banking.Test.csproj @@ -39,7 +39,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 1e76a3b0..ecbe0025 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.Business/Beef.Demo.Business.csproj b/samples/Demo/Beef.Demo.Business/Beef.Demo.Business.csproj index 876874d6..1887a2ba 100644 --- a/samples/Demo/Beef.Demo.Business/Beef.Demo.Business.csproj +++ b/samples/Demo/Beef.Demo.Business/Beef.Demo.Business.csproj @@ -16,14 +16,14 @@ - - - - - - - - + + + + + + + + diff --git a/samples/Demo/Beef.Demo.Business/Data/PersonData.cs b/samples/Demo/Beef.Demo.Business/Data/PersonData.cs index e85c9ca0..4e164c21 100644 --- a/samples/Demo/Beef.Demo.Business/Data/PersonData.cs +++ b/samples/Demo/Beef.Demo.Business/Data/PersonData.cs @@ -36,6 +36,7 @@ private async Task MergeOnImplementationAsync(Guid personFromId, Guid pe private Task MarkOnImplementationAsync() { using var scope = _logger.BeginScope(new Dictionary { { "MyKey", "MyValue" } }); + CoreEx.ExecutionContext.Current.Messages.Add(MessageType.Warning, "Software licence is overdue; please pay immediately or services will be halted."); _logger.LogWarning("Mark operation implementation currently does not exist."); return Task.CompletedTask; } diff --git a/samples/Demo/Beef.Demo.Common/Agents/Generated/ConfigAgent.cs b/samples/Demo/Beef.Demo.Common/Agents/Generated/ConfigAgent.cs index d8b4ae2c..24b05d5b 100644 --- a/samples/Demo/Beef.Demo.Common/Agents/Generated/ConfigAgent.cs +++ b/samples/Demo/Beef.Demo.Common/Agents/Generated/ConfigAgent.cs @@ -10,16 +10,11 @@ namespace Beef.Demo.Common.Agents; /// /// Provides the Config HTTP agent. /// -public partial class ConfigAgent : TypedHttpClientBase, IConfigAgent +/// The underlying . +/// The optional . +/// The optional . +public partial class ConfigAgent(HttpClient client, IJsonSerializer? jsonSerializer = null, CoreEx.ExecutionContext? executionContext = null) : TypedHttpClientBase(client, jsonSerializer, executionContext), IConfigAgent { - /// - /// Initializes a new instance of the class. - /// - /// The underlying . - /// The optional . - /// The optional . - public ConfigAgent(HttpClient client, IJsonSerializer? jsonSerializer = null, CoreEx.ExecutionContext? executionContext = null) : base(client, jsonSerializer, executionContext) { } - /// public Task> GetEnvVarsAsync(HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) => PostAsync("api/v1/envvars", requestOptions: requestOptions, cancellationToken: cancellationToken); diff --git a/samples/Demo/Beef.Demo.Common/Agents/Generated/ContactAgent.cs b/samples/Demo/Beef.Demo.Common/Agents/Generated/ContactAgent.cs index 092d2b95..8b4a3650 100644 --- a/samples/Demo/Beef.Demo.Common/Agents/Generated/ContactAgent.cs +++ b/samples/Demo/Beef.Demo.Common/Agents/Generated/ContactAgent.cs @@ -10,19 +10,14 @@ namespace Beef.Demo.Common.Agents; /// /// Provides the HTTP agent. /// -public partial class ContactAgent : TypedHttpClientBase, IContactAgent +/// The underlying . +/// The optional . +/// The optional . +public partial class ContactAgent(HttpClient client, IJsonSerializer? jsonSerializer = null, CoreEx.ExecutionContext? executionContext = null) : TypedHttpClientBase(client, jsonSerializer, executionContext), IContactAgent { - /// - /// Initializes a new instance of the class. - /// - /// The underlying . - /// The optional . - /// The optional . - public ContactAgent(HttpClient client, IJsonSerializer? jsonSerializer = null, CoreEx.ExecutionContext? executionContext = null) : base(client, jsonSerializer, executionContext) { } - /// public Task> GetByQueryAsync(QueryArgs? query = null, PagingArgs? paging = null, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) - => GetAsync("api/v1/contacts/query", requestOptions: requestOptions.IncludeQuery(query).IncludePaging(paging), args: HttpArgs.Create(), cancellationToken: cancellationToken); + => GetAsync("api/v1/contacts/query", requestOptions: requestOptions.IncludeQuery(query).IncludePaging(paging), cancellationToken: cancellationToken); /// public Task> GetAllAsync(HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) @@ -30,27 +25,27 @@ public Task> GetAllAsync(HttpRequestOptions? /// public Task> GetAsync(Guid id, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) - => GetAsync("api/v1/contacts/{id}", requestOptions: requestOptions, args: HttpArgs.Create(new HttpArg("id", id)), cancellationToken: cancellationToken); + => GetAsync("api/v1/contacts/{id}", requestOptions, [new HttpArg("id", id)], cancellationToken); /// public Task> CreateAsync(Contact value, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) - => PostAsync("api/v1/contacts", value, requestOptions: requestOptions, cancellationToken: cancellationToken); + => PostAsync("api/v1/contacts", value, requestOptions, cancellationToken: cancellationToken); /// public Task> UpdateAsync(Contact value, Guid id, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) - => PutAsync("api/v1/contacts/{id}", value, requestOptions: requestOptions, args: HttpArgs.Create(new HttpArg("id", id)), cancellationToken: cancellationToken); + => PutAsync("api/v1/contacts/{id}", value, requestOptions, [new HttpArg("id", id)], cancellationToken); /// public Task> PatchAsync(HttpPatchOption patchOption, string value, Guid id, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) - => PatchAsync("api/v1/contacts/{id}", patchOption, value, requestOptions: requestOptions, args: HttpArgs.Create(new HttpArg("id", id)), cancellationToken: cancellationToken); + => PatchAsync("api/v1/contacts/{id}", patchOption, value, requestOptions, [new HttpArg("id", id)], cancellationToken); /// public Task DeleteAsync(Guid id, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) - => DeleteAsync("api/v1/contacts/{id}", requestOptions: requestOptions, args: HttpArgs.Create(new HttpArg("id", id)), cancellationToken: cancellationToken); + => DeleteAsync("api/v1/contacts/{id}", requestOptions, [new HttpArg("id", id)], cancellationToken); /// public Task RaiseEventAsync(bool throwError, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) - => PostAsync("api/v1/contacts/raise", requestOptions: requestOptions, args: HttpArgs.Create(new HttpArg("throwError", throwError)), cancellationToken: cancellationToken); + => PostAsync("api/v1/contacts/raise", requestOptions, [new HttpArg("throwError", throwError)], cancellationToken); } #pragma warning restore diff --git a/samples/Demo/Beef.Demo.Common/Agents/Generated/GenderAgent.cs b/samples/Demo/Beef.Demo.Common/Agents/Generated/GenderAgent.cs index 7765782c..273c6ac1 100644 --- a/samples/Demo/Beef.Demo.Common/Agents/Generated/GenderAgent.cs +++ b/samples/Demo/Beef.Demo.Common/Agents/Generated/GenderAgent.cs @@ -10,27 +10,22 @@ namespace Beef.Demo.Common.Agents; /// /// Provides the HTTP agent. /// -public partial class GenderAgent : TypedHttpClientBase, IGenderAgent +/// The underlying . +/// The optional . +/// The optional . +public partial class GenderAgent(HttpClient client, IJsonSerializer? jsonSerializer = null, CoreEx.ExecutionContext? executionContext = null) : TypedHttpClientBase(client, jsonSerializer, executionContext), IGenderAgent { - /// - /// Initializes a new instance of the class. - /// - /// The underlying . - /// The optional . - /// The optional . - public GenderAgent(HttpClient client, IJsonSerializer? jsonSerializer = null, CoreEx.ExecutionContext? executionContext = null) : base(client, jsonSerializer, executionContext) { } - /// public Task> GetAsync(Guid id, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) - => GetAsync("api/v1/demo/ref/genders/{id}", requestOptions: requestOptions, args: HttpArgs.Create(new HttpArg("id", id)), cancellationToken: cancellationToken); + => GetAsync("api/v1/demo/ref/genders/{id}", requestOptions, [new HttpArg("id", id)], cancellationToken); /// public Task> CreateAsync(Gender value, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) - => PostAsync("api/v1/demo/ref/genders", value, requestOptions: requestOptions, cancellationToken: cancellationToken); + => PostAsync("api/v1/demo/ref/genders", value, requestOptions, cancellationToken: cancellationToken); /// public Task> UpdateAsync(Gender value, Guid id, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) - => PutAsync("api/v1/demo/ref/genders/{id}", value, requestOptions: requestOptions, args: HttpArgs.Create(new HttpArg("id", id)), cancellationToken: cancellationToken); + => PutAsync("api/v1/demo/ref/genders/{id}", value, requestOptions, [new HttpArg("id", id)], cancellationToken); } #pragma warning restore diff --git a/samples/Demo/Beef.Demo.Common/Agents/Generated/PersonAgent.cs b/samples/Demo/Beef.Demo.Common/Agents/Generated/PersonAgent.cs index 27a2549d..e1649394 100644 --- a/samples/Demo/Beef.Demo.Common/Agents/Generated/PersonAgent.cs +++ b/samples/Demo/Beef.Demo.Common/Agents/Generated/PersonAgent.cs @@ -10,47 +10,42 @@ namespace Beef.Demo.Common.Agents; /// /// Provides the HTTP agent. /// -public partial class PersonAgent : TypedHttpClientBase, IPersonAgent +/// The underlying . +/// The optional . +/// The optional . +public partial class PersonAgent(HttpClient client, IJsonSerializer? jsonSerializer = null, CoreEx.ExecutionContext? executionContext = null) : TypedHttpClientBase(client, jsonSerializer, executionContext), IPersonAgent { - /// - /// Initializes a new instance of the class. - /// - /// The underlying . - /// The optional . - /// The optional . - public PersonAgent(HttpClient client, IJsonSerializer? jsonSerializer = null, CoreEx.ExecutionContext? executionContext = null) : base(client, jsonSerializer, executionContext) { } - /// public Task> CreateAsync(Person value, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) - => PostAsync("api/v1/persons", value, requestOptions: requestOptions, cancellationToken: cancellationToken); + => PostAsync("api/v1/persons", value, requestOptions, cancellationToken: cancellationToken); /// public Task DeleteAsync(Guid id, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) - => DeleteAsync("api/v1/persons/{id}", requestOptions: requestOptions, args: HttpArgs.Create(new HttpArg("id", id)), cancellationToken: cancellationToken); + => DeleteAsync("api/v1/persons/{id}", requestOptions, [new HttpArg("id", id)], cancellationToken); /// public Task> GetAsync(Guid id, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) - => GetAsync("api/v1/persons/{id}", requestOptions: requestOptions, args: HttpArgs.Create(new HttpArg("id", id)), cancellationToken: cancellationToken); + => GetAsync("api/v1/persons/{id}", requestOptions, [new HttpArg("id", id)], cancellationToken); /// public Task> GetExAsync(Guid id, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) - => GetAsync("api/v1/persons/ex/{id}", requestOptions: requestOptions, args: HttpArgs.Create(new HttpArg("id", id)), cancellationToken: cancellationToken); + => GetAsync("api/v1/persons/ex/{id}", requestOptions, [new HttpArg("id", id)], cancellationToken); /// public Task> UpdateAsync(Person value, Guid id, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) - => PutAsync("api/v1/persons/{id}", value, requestOptions: requestOptions, args: HttpArgs.Create(new HttpArg("id", id)), cancellationToken: cancellationToken); + => PutAsync("api/v1/persons/{id}", value, requestOptions, [new HttpArg("id", id)], cancellationToken); /// public Task> UpdateWithRollbackAsync(Person value, Guid id, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) - => PutAsync("api/v1/persons/withRollback/{id}", value, requestOptions: requestOptions, args: HttpArgs.Create(new HttpArg("id", id)), cancellationToken: cancellationToken); + => PutAsync("api/v1/persons/withRollback/{id}", value, requestOptions, [new HttpArg("id", id)], cancellationToken); /// public Task> PatchAsync(HttpPatchOption patchOption, string value, Guid id, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) - => PatchAsync("api/v1/persons/{id}", patchOption, value, requestOptions: requestOptions, args: HttpArgs.Create(new HttpArg("id", id)), cancellationToken: cancellationToken); + => PatchAsync("api/v1/persons/{id}", patchOption, value, requestOptions, [new HttpArg("id", id)], cancellationToken); /// public Task> GetAllAsync(PagingArgs? paging = null, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) - => GetAsync("api/v1/persons/all", requestOptions: requestOptions.IncludePaging(paging), args: HttpArgs.Create(), cancellationToken: cancellationToken); + => GetAsync("api/v1/persons/all", requestOptions: requestOptions.IncludePaging(paging), cancellationToken: cancellationToken); /// public Task> GetAll2Async(HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) @@ -58,15 +53,15 @@ public Task> GetAll2Async(HttpRequestOptions? /// public Task> GetByArgsAsync(PersonArgs? args, PagingArgs? paging = null, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) - => GetAsync("api/v1/persons", requestOptions: requestOptions.IncludePaging(paging), args: HttpArgs.Create(new HttpArg("args", args, HttpArgType.FromUriUseProperties)), cancellationToken: cancellationToken); + => GetAsync("api/v1/persons", requestOptions.IncludePaging(paging), [new HttpArg("args", args, HttpArgType.FromUriUseProperties)], cancellationToken); /// public Task> GetDetailByArgsAsync(PersonArgs? args, PagingArgs? paging = null, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) - => GetAsync("api/v1/persons/argsdetail", requestOptions: requestOptions.IncludePaging(paging), args: HttpArgs.Create(new HttpArg("args", args, HttpArgType.FromUriUseProperties)), cancellationToken: cancellationToken); + => GetAsync("api/v1/persons/argsdetail", requestOptions.IncludePaging(paging), [new HttpArg("args", args, HttpArgType.FromUriUseProperties)], cancellationToken); /// public Task> MergeAsync(Guid fromId, Guid toId, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) - => PostAsync("api/v1/persons/merge", requestOptions: requestOptions, args: HttpArgs.Create(new HttpArg("fromId", fromId), new HttpArg("toId", toId)), cancellationToken: cancellationToken); + => PostAsync("api/v1/persons/merge", requestOptions, [new HttpArg("fromId", fromId), new HttpArg("toId", toId)], cancellationToken); /// public Task MarkAsync(HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) @@ -74,7 +69,7 @@ public Task MarkAsync(HttpRequestOptions? requestOptions = null, Can /// public Task> MapAsync(MapArgs? args, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) - => PostAsync("api/v1/persons/map", requestOptions: requestOptions, args: HttpArgs.Create(new HttpArg("args", args, HttpArgType.FromUriUseProperties)), cancellationToken: cancellationToken); + => PostAsync("api/v1/persons/map", requestOptions, [new HttpArg("args", args, HttpArgType.FromUriUseProperties)], cancellationToken); /// public Task> GetNoArgsAsync(HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) @@ -82,27 +77,27 @@ public Task> MapAsync(MapArgs? args, HttpRequestOptio /// public Task> GetDetailAsync(Guid id, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) - => GetAsync("api/v1/persons/{id}/detail", requestOptions: requestOptions, args: HttpArgs.Create(new HttpArg("id", id)), cancellationToken: cancellationToken); + => GetAsync("api/v1/persons/{id}/detail", requestOptions, [new HttpArg("id", id)], cancellationToken); /// public Task> UpdateDetailAsync(PersonDetail value, Guid id, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) - => PutAsync("api/v1/persons/{id}/detail", value, requestOptions: requestOptions, args: HttpArgs.Create(new HttpArg("id", id)), cancellationToken: cancellationToken); + => PutAsync("api/v1/persons/{id}/detail", value, requestOptions, [new HttpArg("id", id)], cancellationToken); /// public Task> PatchDetailAsync(HttpPatchOption patchOption, string value, Guid id, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) - => PatchAsync("api/v1/persons/{id}/detail", patchOption, value, requestOptions: requestOptions, args: HttpArgs.Create(new HttpArg("id", id)), cancellationToken: cancellationToken); + => PatchAsync("api/v1/persons/{id}/detail", patchOption, value, requestOptions, [new HttpArg("id", id)], cancellationToken); /// public Task AddAsync(Person person, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) - => PostAsync("api/v1/persons/fromBody", requestOptions: requestOptions, args: HttpArgs.Create(new HttpArg("person", person, HttpArgType.FromBody)), cancellationToken: cancellationToken); + => PostAsync("api/v1/persons/fromBody", requestOptions, [new HttpArg("person", person, HttpArgType.FromBody)], cancellationToken); /// public Task Add2Async(Person person, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) - => PostAsync("api/v1/persons/acceptsBody", person, requestOptions: requestOptions, cancellationToken: cancellationToken); + => PostAsync("api/v1/persons/acceptsBody", person, requestOptions, cancellationToken: cancellationToken); /// public Task Add3Async(Person value, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) - => PostAsync("api/v1/persons/acceptsBodyValue", value, requestOptions: requestOptions, cancellationToken: cancellationToken); + => PostAsync("api/v1/persons/acceptsBodyValue", value, requestOptions, cancellationToken: cancellationToken); /// public Task CustomManagerOnlyAsync(HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) @@ -110,15 +105,15 @@ public Task CustomManagerOnlyAsync(HttpRequestOptions? requestOption /// public Task> GetNullAsync(string? name, List? names, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) - => GetAsync("api/v1/persons/null", requestOptions: requestOptions, args: HttpArgs.Create(new HttpArg("name", name), new HttpArg?>("names", names)), cancellationToken: cancellationToken); + => GetAsync("api/v1/persons/null", requestOptions, [new HttpArg("name", name), new HttpArg?>("names", names)], cancellationToken); /// public Task> EventPublishNoSendAsync(Person value, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) - => PutAsync("api/v1/persons/publishnosend", value, requestOptions: requestOptions, cancellationToken: cancellationToken); + => PutAsync("api/v1/persons/publishnosend", value, requestOptions, cancellationToken: cancellationToken); /// public Task> GetByArgsWithEfAsync(PersonArgs? args, PagingArgs? paging = null, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) - => GetAsync("api/v1/persons/args", requestOptions: requestOptions.IncludePaging(paging), args: HttpArgs.Create(new HttpArg("args", args, HttpArgType.FromUriUseProperties)), cancellationToken: cancellationToken); + => GetAsync("api/v1/persons/args", requestOptions.IncludePaging(paging), [new HttpArg("args", args, HttpArgType.FromUriUseProperties)], cancellationToken); /// public Task ThrowErrorAsync(HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) @@ -126,43 +121,43 @@ public Task ThrowErrorAsync(HttpRequestOptions? requestOptions = nul /// public Task> InvokeApiViaAgentAsync(Guid id, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) - => PostAsync("api/v1/persons/invokeApi", requestOptions: requestOptions, args: HttpArgs.Create(new HttpArg("id", id)), cancellationToken: cancellationToken); + => PostAsync("api/v1/persons/invokeApi", requestOptions, [new HttpArg("id", id)], cancellationToken); /// public Task ParamCollAsync(AddressCollection? addresses, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) - => PostAsync("api/v1/persons/paramcoll", requestOptions: requestOptions, args: HttpArgs.Create(new HttpArg("addresses", addresses, HttpArgType.FromBody)), cancellationToken: cancellationToken); + => PostAsync("api/v1/persons/paramcoll", requestOptions, [new HttpArg("addresses", addresses, HttpArgType.FromBody)], cancellationToken); /// public Task> GetWithEfAsync(Guid id, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) - => GetAsync("api/v1/persons/ef/{id}", requestOptions: requestOptions, args: HttpArgs.Create(new HttpArg("id", id)), cancellationToken: cancellationToken); + => GetAsync("api/v1/persons/ef/{id}", requestOptions, [new HttpArg("id", id)], cancellationToken); /// public Task> CreateWithEfAsync(Person value, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) - => PostAsync("api/v1/persons/ef", value, requestOptions: requestOptions, cancellationToken: cancellationToken); + => PostAsync("api/v1/persons/ef", value, requestOptions, cancellationToken: cancellationToken); /// public Task> UpdateWithEfAsync(Person value, Guid id, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) - => PutAsync("api/v1/persons/ef/{id}", value, requestOptions: requestOptions, args: HttpArgs.Create(new HttpArg("id", id)), cancellationToken: cancellationToken); + => PutAsync("api/v1/persons/ef/{id}", value, requestOptions, [new HttpArg("id", id)], cancellationToken); /// public Task DeleteWithEfAsync(Guid id, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) - => DeleteAsync("api/v1/persons/ef/{id}", requestOptions: requestOptions, args: HttpArgs.Create(new HttpArg("id", id)), cancellationToken: cancellationToken); + => DeleteAsync("api/v1/persons/ef/{id}", requestOptions, [new HttpArg("id", id)], cancellationToken); /// public Task> PatchWithEfAsync(HttpPatchOption patchOption, string value, Guid id, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) - => PatchAsync("api/v1/persons/ef/{id}", patchOption, value, requestOptions: requestOptions, args: HttpArgs.Create(new HttpArg("id", id)), cancellationToken: cancellationToken); + => PatchAsync("api/v1/persons/ef/{id}", patchOption, value, requestOptions, [new HttpArg("id", id)], cancellationToken); /// public Task GetDocumentationAsync(Guid id, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) - => GetAsync("api/v1/persons/{id}/documentation", requestOptions: requestOptions, args: HttpArgs.Create(new HttpArg("id", id)), cancellationToken: cancellationToken); + => GetAsync("api/v1/persons/{id}/documentation", requestOptions, [new HttpArg("id", id)], cancellationToken); /// public Task> SimulateWorkAsync(Guid id, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) - => GetAsync("api/v1/persons/simulate", requestOptions: requestOptions, args: HttpArgs.Create(new HttpArg("id", id)), cancellationToken: cancellationToken); + => GetAsync("api/v1/persons/simulate", requestOptions, [new HttpArg("id", id)], cancellationToken); /// public Task> ExtendResponseAsync(string? name, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) - => PostAsync("api/v1/persons/extend-response", requestOptions: requestOptions, args: HttpArgs.Create(new HttpArg("name", name)), cancellationToken: cancellationToken); + => PostAsync("api/v1/persons/extend-response", requestOptions, [new HttpArg("name", name)], cancellationToken); } #pragma warning restore diff --git a/samples/Demo/Beef.Demo.Common/Agents/Generated/PostalInfoAgent.cs b/samples/Demo/Beef.Demo.Common/Agents/Generated/PostalInfoAgent.cs index ad664108..0c5f56b5 100644 --- a/samples/Demo/Beef.Demo.Common/Agents/Generated/PostalInfoAgent.cs +++ b/samples/Demo/Beef.Demo.Common/Agents/Generated/PostalInfoAgent.cs @@ -10,35 +10,30 @@ namespace Beef.Demo.Common.Agents; /// /// Provides the HTTP agent. /// -public partial class PostalInfoAgent : TypedHttpClientBase, IPostalInfoAgent +/// The underlying . +/// The optional . +/// The optional . +public partial class PostalInfoAgent(HttpClient client, IJsonSerializer? jsonSerializer = null, CoreEx.ExecutionContext? executionContext = null) : TypedHttpClientBase(client, jsonSerializer, executionContext), IPostalInfoAgent { - /// - /// Initializes a new instance of the class. - /// - /// The underlying . - /// The optional . - /// The optional . - public PostalInfoAgent(HttpClient client, IJsonSerializer? jsonSerializer = null, CoreEx.ExecutionContext? executionContext = null) : base(client, jsonSerializer, executionContext) { } - /// public Task> GetPostCodesAsync(string? country, string? state, string? city, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) - => GetAsync("api/v1/postal/{country}/{state}/{city}", requestOptions: requestOptions, args: HttpArgs.Create(new HttpArg("country", country), new HttpArg("state", state), new HttpArg("city", city)), cancellationToken: cancellationToken); + => GetAsync("api/v1/postal/{country}/{state}/{city}", requestOptions, [new HttpArg("country", country), new HttpArg("state", state), new HttpArg("city", city)], cancellationToken); /// public Task> CreatePostCodesAsync(PostalInfo value, string? country, string? state, string? city, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) - => PostAsync("api/v1/postal/{country}/{state}/{city}", value, requestOptions: requestOptions, args: HttpArgs.Create(new HttpArg("country", country), new HttpArg("state", state), new HttpArg("city", city)), cancellationToken: cancellationToken); + => PostAsync("api/v1/postal/{country}/{state}/{city}", value, requestOptions, [new HttpArg("country", country), new HttpArg("state", state), new HttpArg("city", city)], cancellationToken); /// public Task> UpdatePostCodesAsync(PostalInfo value, string? country, string? state, string? city, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) - => PutAsync("api/v1/postal/{country}/{state}/{city}", value, requestOptions: requestOptions, args: HttpArgs.Create(new HttpArg("country", country), new HttpArg("state", state), new HttpArg("city", city)), cancellationToken: cancellationToken); + => PutAsync("api/v1/postal/{country}/{state}/{city}", value, requestOptions, [new HttpArg("country", country), new HttpArg("state", state), new HttpArg("city", city)], cancellationToken); /// public Task> PatchPostCodesAsync(HttpPatchOption patchOption, string value, string? country, string? state, string? city, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) - => PatchAsync("api/v1/postal/{country}/{state}/{city}", patchOption, value, requestOptions: requestOptions, args: HttpArgs.Create(new HttpArg("country", country), new HttpArg("state", state), new HttpArg("city", city)), cancellationToken: cancellationToken); + => PatchAsync("api/v1/postal/{country}/{state}/{city}", patchOption, value, requestOptions, [new HttpArg("country", country), new HttpArg("state", state), new HttpArg("city", city)], cancellationToken); /// public Task DeletePostCodesAsync(string? country, string? state, string? city, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) - => DeleteAsync("api/v1/postal/{country}/{state}/{city}", requestOptions: requestOptions, args: HttpArgs.Create(new HttpArg("country", country), new HttpArg("state", state), new HttpArg("city", city)), cancellationToken: cancellationToken); + => DeleteAsync("api/v1/postal/{country}/{state}/{city}", requestOptions, [new HttpArg("country", country), new HttpArg("state", state), new HttpArg("city", city)], cancellationToken); } #pragma warning restore diff --git a/samples/Demo/Beef.Demo.Common/Agents/Generated/ReferenceDataAgent.cs b/samples/Demo/Beef.Demo.Common/Agents/Generated/ReferenceDataAgent.cs index 6550d601..fac089ed 100644 --- a/samples/Demo/Beef.Demo.Common/Agents/Generated/ReferenceDataAgent.cs +++ b/samples/Demo/Beef.Demo.Common/Agents/Generated/ReferenceDataAgent.cs @@ -10,47 +10,42 @@ namespace Beef.Demo.Common.Agents; /// /// Provides the ReferenceData HTTP agent. /// -public partial class ReferenceDataAgent : TypedHttpClientBase, IReferenceDataAgent +/// The underlying . +/// The optional . +/// The optional . +public partial class ReferenceDataAgent(HttpClient client, IJsonSerializer? jsonSerializer = null, CoreEx.ExecutionContext? executionContext = null) : TypedHttpClientBase(client, jsonSerializer, executionContext), IReferenceDataAgent { - /// - /// Initializes a new instance of the class. - /// - /// The underlying . - /// The optional . - /// The optional . - public ReferenceDataAgent(HttpClient client, IJsonSerializer? jsonSerializer = null, CoreEx.ExecutionContext? executionContext = null) : base(client, jsonSerializer, executionContext) { } - /// 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); + => GetAsync("api/v1/demo/ref/countries", requestOptions, [new HttpArg("args", args, HttpArgType.FromUriUseProperties)], cancellationToken); /// 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); + => GetAsync("api/v1/demo/ref/usStates", requestOptions, [new HttpArg("args", args, HttpArgType.FromUriUseProperties)], cancellationToken); /// 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); + => GetAsync("api/v1/demo/ref/genders", requestOptions, [new HttpArg("args", args, HttpArgType.FromUriUseProperties)], cancellationToken); /// 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); + => GetAsync("api/v1/demo/ref/eyeColors", requestOptions, [new HttpArg("args", args, HttpArgType.FromUriUseProperties)], cancellationToken); /// 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); + => GetAsync("api/v1/demo/ref/powerSources", requestOptions, [new HttpArg("args", args, HttpArgType.FromUriUseProperties)], cancellationToken); /// 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); + => GetAsync("api/v1/demo/ref/companies", requestOptions, [new HttpArg("args", args, HttpArgType.FromUriUseProperties)], cancellationToken); /// 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); + => GetAsync("api/v1/demo/ref/statuses", requestOptions, [new HttpArg("args", args, HttpArgType.FromUriUseProperties)], cancellationToken); /// 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); + => GetAsync("api/v1/demo/ref/communicationTypes", requestOptions, [new HttpArg("args", args, HttpArgType.FromUriUseProperties)], cancellationToken); /// public Task GetNamedAsync(string[] names, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) diff --git a/samples/Demo/Beef.Demo.Common/Agents/Generated/RobotAgent.cs b/samples/Demo/Beef.Demo.Common/Agents/Generated/RobotAgent.cs index 261a249d..0c9d98ee 100644 --- a/samples/Demo/Beef.Demo.Common/Agents/Generated/RobotAgent.cs +++ b/samples/Demo/Beef.Demo.Common/Agents/Generated/RobotAgent.cs @@ -10,43 +10,38 @@ namespace Beef.Demo.Common.Agents; /// /// Provides the HTTP agent. /// -public partial class RobotAgent : TypedHttpClientBase, IRobotAgent +/// The underlying . +/// The optional . +/// The optional . +public partial class RobotAgent(HttpClient client, IJsonSerializer? jsonSerializer = null, CoreEx.ExecutionContext? executionContext = null) : TypedHttpClientBase(client, jsonSerializer, executionContext), IRobotAgent { - /// - /// Initializes a new instance of the class. - /// - /// The underlying . - /// The optional . - /// The optional . - public RobotAgent(HttpClient client, IJsonSerializer? jsonSerializer = null, CoreEx.ExecutionContext? executionContext = null) : base(client, jsonSerializer, executionContext) { } - /// public Task> GetAsync(Guid id, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) - => GetAsync("api/v1/robots/{id}", requestOptions: requestOptions, args: HttpArgs.Create(new HttpArg("id", id)), cancellationToken: cancellationToken); + => GetAsync("api/v1/robots/{id}", requestOptions, [new HttpArg("id", id)], cancellationToken); /// public Task> CreateAsync(Robot value, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) - => PostAsync("api/v1/robots", value, requestOptions: requestOptions, cancellationToken: cancellationToken); + => PostAsync("api/v1/robots", value, requestOptions, cancellationToken: cancellationToken); /// public Task> UpdateAsync(Robot value, Guid id, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) - => PutAsync("api/v1/robots/{id}", value, requestOptions: requestOptions, args: HttpArgs.Create(new HttpArg("id", id)), cancellationToken: cancellationToken); + => PutAsync("api/v1/robots/{id}", value, requestOptions, [new HttpArg("id", id)], cancellationToken); /// public Task> PatchAsync(HttpPatchOption patchOption, string value, Guid id, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) - => PatchAsync("api/v1/robots/{id}", patchOption, value, requestOptions: requestOptions, args: HttpArgs.Create(new HttpArg("id", id)), cancellationToken: cancellationToken); + => PatchAsync("api/v1/robots/{id}", patchOption, value, requestOptions, [new HttpArg("id", id)], cancellationToken); /// public Task DeleteAsync(Guid id, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) - => DeleteAsync("api/v1/robots/{id}", requestOptions: requestOptions, args: HttpArgs.Create(new HttpArg("id", id)), cancellationToken: cancellationToken); + => DeleteAsync("api/v1/robots/{id}", requestOptions, [new HttpArg("id", id)], cancellationToken); /// public Task> GetByArgsAsync(RobotArgs? args, PagingArgs? paging = null, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) - => GetAsync("api/v1/robots", requestOptions: requestOptions.IncludePaging(paging), args: HttpArgs.Create(new HttpArg("args", args, HttpArgType.FromUriUseProperties)), cancellationToken: cancellationToken); + => GetAsync("api/v1/robots", requestOptions.IncludePaging(paging), [new HttpArg("args", args, HttpArgType.FromUriUseProperties)], cancellationToken); /// public Task RaisePowerSourceChangeAsync(Guid id, string? powerSource, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) - => PostAsync("api/v1/robots/{id}/powerSource/{powerSource}", requestOptions: requestOptions, args: HttpArgs.Create(new HttpArg("id", id), new HttpArg("powerSource", powerSource)), cancellationToken: cancellationToken); + => PostAsync("api/v1/robots/{id}/powerSource/{powerSource}", requestOptions, [new HttpArg("id", id), new HttpArg("powerSource", powerSource)], cancellationToken); } #pragma warning restore diff --git a/samples/Demo/Beef.Demo.Common/Beef.Demo.Common.csproj b/samples/Demo/Beef.Demo.Common/Beef.Demo.Common.csproj index 910794cb..7f084664 100644 --- a/samples/Demo/Beef.Demo.Common/Beef.Demo.Common.csproj +++ b/samples/Demo/Beef.Demo.Common/Beef.Demo.Common.csproj @@ -9,7 +9,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 70b5c75f..46061949 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/PersonTest.cs b/samples/Demo/Beef.Demo.Test/PersonTest.cs index 18ca2463..75476497 100644 --- a/samples/Demo/Beef.Demo.Test/PersonTest.cs +++ b/samples/Demo/Beef.Demo.Test/PersonTest.cs @@ -1209,10 +1209,17 @@ public void I120_Mark() .ExpectEvent("Demo.Mark", "Marked") .Run(a => a.MarkAsync()); - AgentTester.Test() + var hr = AgentTester.Test() .ExpectStatusCode(HttpStatusCode.Accepted) .ExpectEvent(new EventData { Subject = "Demo.Mark", Action = "Marked", Value = "Wahlberg" }) - .Run(a => a.MarkAsync()); + .Run(a => a.MarkAsync()) + .Result; + + Assert.That(hr.Messages, Is.Not.Null); + Assert.That(hr.Messages, Has.Count.EqualTo(1)); + Assert.That(hr.Messages[0].Type, Is.EqualTo(MessageType.Warning)); + Assert.That(hr.Messages[0].Text, Is.EqualTo("Software licence is overdue; please pay immediately or services will be halted.")); + } [Test, TestSetUp] 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 fd6fca90..b5450bbb 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 e3d1d353..180dc43b 100644 --- a/samples/My.Hr/My.Hr.Business/My.Hr.Business.csproj +++ b/samples/My.Hr/My.Hr.Business/My.Hr.Business.csproj @@ -6,10 +6,10 @@ latest - - - - + + + + \ No newline at end of file diff --git a/samples/My.Hr/My.Hr.Common/Agents/Generated/EmployeeAgent.cs b/samples/My.Hr/My.Hr.Common/Agents/Generated/EmployeeAgent.cs index 133ca515..605d9e10 100644 --- a/samples/My.Hr/My.Hr.Common/Agents/Generated/EmployeeAgent.cs +++ b/samples/My.Hr/My.Hr.Common/Agents/Generated/EmployeeAgent.cs @@ -7,41 +7,36 @@ namespace My.Hr.Common.Agents; /// /// Provides the HTTP agent. /// -public partial class EmployeeAgent : TypedHttpClientBase, IEmployeeAgent +/// The underlying . +/// The optional . +/// The optional . +public partial class EmployeeAgent(HttpClient client, IJsonSerializer? jsonSerializer = null, CoreEx.ExecutionContext? executionContext = null) : TypedHttpClientBase(client, jsonSerializer, executionContext), IEmployeeAgent { - /// - /// Initializes a new instance of the class. - /// - /// The underlying . - /// The optional . - /// The optional . - public EmployeeAgent(HttpClient client, IJsonSerializer? jsonSerializer = null, CoreEx.ExecutionContext? executionContext = null) : base(client, jsonSerializer, executionContext) { } - /// public Task> GetAsync(Guid id, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) - => GetAsync("employees/{id}", requestOptions: requestOptions, args: HttpArgs.Create(new HttpArg("id", id)), cancellationToken: cancellationToken); + => GetAsync("employees/{id}", requestOptions, [new HttpArg("id", id)], cancellationToken); /// public Task> CreateAsync(Employee value, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) - => PostAsync("employees", value, requestOptions: requestOptions, cancellationToken: cancellationToken); + => PostAsync("employees", value, requestOptions, cancellationToken: cancellationToken); /// public Task> UpdateAsync(Employee value, Guid id, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) - => PutAsync("employees/{id}", value, requestOptions: requestOptions, args: HttpArgs.Create(new HttpArg("id", id)), cancellationToken: cancellationToken); + => PutAsync("employees/{id}", value, requestOptions, [new HttpArg("id", id)], cancellationToken); /// public Task> PatchAsync(HttpPatchOption patchOption, string value, Guid id, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) - => PatchAsync("employees/{id}", patchOption, value, requestOptions: requestOptions, args: HttpArgs.Create(new HttpArg("id", id)), cancellationToken: cancellationToken); + => PatchAsync("employees/{id}", patchOption, value, requestOptions, [new HttpArg("id", id)], cancellationToken); /// public Task DeleteAsync(Guid id, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) - => DeleteAsync("employees/{id}", requestOptions: requestOptions, args: HttpArgs.Create(new HttpArg("id", id)), cancellationToken: cancellationToken); + => DeleteAsync("employees/{id}", requestOptions, [new HttpArg("id", id)], cancellationToken); /// public Task> GetByArgsAsync(EmployeeArgs? args, PagingArgs? paging = null, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) - => GetAsync("employees", requestOptions: requestOptions.IncludePaging(paging), args: HttpArgs.Create(new HttpArg("args", args, HttpArgType.FromUriUseProperties)), cancellationToken: cancellationToken); + => GetAsync("employees", requestOptions.IncludePaging(paging), [new HttpArg("args", args, HttpArgType.FromUriUseProperties)], cancellationToken); /// public Task> TerminateAsync(TerminationDetail value, Guid id, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) - => PostAsync("employees/{id}/terminate", value, requestOptions: requestOptions, args: HttpArgs.Create(new HttpArg("id", id)), cancellationToken: cancellationToken); + => PostAsync("employees/{id}/terminate", value, requestOptions, [new HttpArg("id", id)], cancellationToken); } \ No newline at end of file diff --git a/samples/My.Hr/My.Hr.Common/Agents/Generated/PerformanceReviewAgent.cs b/samples/My.Hr/My.Hr.Common/Agents/Generated/PerformanceReviewAgent.cs index c73fd140..18647304 100644 --- a/samples/My.Hr/My.Hr.Common/Agents/Generated/PerformanceReviewAgent.cs +++ b/samples/My.Hr/My.Hr.Common/Agents/Generated/PerformanceReviewAgent.cs @@ -7,37 +7,32 @@ namespace My.Hr.Common.Agents; /// /// Provides the HTTP agent. /// -public partial class PerformanceReviewAgent : TypedHttpClientBase, IPerformanceReviewAgent +/// The underlying . +/// The optional . +/// The optional . +public partial class PerformanceReviewAgent(HttpClient client, IJsonSerializer? jsonSerializer = null, CoreEx.ExecutionContext? executionContext = null) : TypedHttpClientBase(client, jsonSerializer, executionContext), IPerformanceReviewAgent { - /// - /// Initializes a new instance of the class. - /// - /// The underlying . - /// The optional . - /// The optional . - public PerformanceReviewAgent(HttpClient client, IJsonSerializer? jsonSerializer = null, CoreEx.ExecutionContext? executionContext = null) : base(client, jsonSerializer, executionContext) { } - /// public Task> GetAsync(Guid id, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) - => GetAsync("reviews/{id}", requestOptions: requestOptions, args: HttpArgs.Create(new HttpArg("id", id)), cancellationToken: cancellationToken); + => GetAsync("reviews/{id}", requestOptions, [new HttpArg("id", id)], cancellationToken); /// public Task> GetByEmployeeIdAsync(Guid employeeId, PagingArgs? paging = null, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) - => GetAsync("employees/{employeeId}/reviews", requestOptions: requestOptions.IncludePaging(paging), args: HttpArgs.Create(new HttpArg("employeeId", employeeId)), cancellationToken: cancellationToken); + => GetAsync("employees/{employeeId}/reviews", requestOptions.IncludePaging(paging), [new HttpArg("employeeId", employeeId)], cancellationToken); /// public Task> CreateAsync(PerformanceReview value, Guid employeeId, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) - => PostAsync("employees/{employeeId}/reviews", value, requestOptions: requestOptions, args: HttpArgs.Create(new HttpArg("employeeId", employeeId)), cancellationToken: cancellationToken); + => PostAsync("employees/{employeeId}/reviews", value, requestOptions, [new HttpArg("employeeId", employeeId)], cancellationToken); /// public Task> UpdateAsync(PerformanceReview value, Guid id, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) - => PutAsync("reviews/{id}", value, requestOptions: requestOptions, args: HttpArgs.Create(new HttpArg("id", id)), cancellationToken: cancellationToken); + => PutAsync("reviews/{id}", value, requestOptions, [new HttpArg("id", id)], cancellationToken); /// public Task> PatchAsync(HttpPatchOption patchOption, string value, Guid id, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) - => PatchAsync("reviews/{id}", patchOption, value, requestOptions: requestOptions, args: HttpArgs.Create(new HttpArg("id", id)), cancellationToken: cancellationToken); + => PatchAsync("reviews/{id}", patchOption, value, requestOptions, [new HttpArg("id", id)], cancellationToken); /// public Task DeleteAsync(Guid id, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) - => DeleteAsync("reviews/{id}", requestOptions: requestOptions, args: HttpArgs.Create(new HttpArg("id", id)), cancellationToken: cancellationToken); + => DeleteAsync("reviews/{id}", requestOptions, [new HttpArg("id", id)], cancellationToken); } \ 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 cfb7173b..e8657b33 100644 --- a/samples/My.Hr/My.Hr.Common/Agents/Generated/ReferenceDataAgent.cs +++ b/samples/My.Hr/My.Hr.Common/Agents/Generated/ReferenceDataAgent.cs @@ -7,35 +7,30 @@ namespace My.Hr.Common.Agents; /// /// Provides the ReferenceData HTTP agent. /// -public partial class ReferenceDataAgent : TypedHttpClientBase, IReferenceDataAgent +/// The underlying . +/// The optional . +/// The optional . +public partial class ReferenceDataAgent(HttpClient client, IJsonSerializer? jsonSerializer = null, CoreEx.ExecutionContext? executionContext = null) : TypedHttpClientBase(client, jsonSerializer, executionContext), IReferenceDataAgent { - /// - /// Initializes a new instance of the class. - /// - /// The underlying . - /// The optional . - /// The optional . - public ReferenceDataAgent(HttpClient client, IJsonSerializer? jsonSerializer = null, CoreEx.ExecutionContext? executionContext = null) : base(client, jsonSerializer, executionContext) { } - /// 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); + => GetAsync("ref/genders", requestOptions, [new HttpArg("args", args, HttpArgType.FromUriUseProperties)], cancellationToken); /// 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); + => GetAsync("ref/terminationReasons", requestOptions, [new HttpArg("args", args, HttpArgType.FromUriUseProperties)], cancellationToken); /// 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); + => GetAsync("ref/relationshipTypes", requestOptions, [new HttpArg("args", args, HttpArgType.FromUriUseProperties)], cancellationToken); /// 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); + => GetAsync("ref/usStates", requestOptions, [new HttpArg("args", args, HttpArgType.FromUriUseProperties)], cancellationToken); /// 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); + => GetAsync("ref/performanceOutcomes", requestOptions, [new HttpArg("args", args, HttpArgType.FromUriUseProperties)], cancellationToken); /// public Task GetNamedAsync(string[] names, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) 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 90fc6275..0af66a9b 100644 --- a/samples/My.Hr/My.Hr.Common/My.Hr.Common.csproj +++ b/samples/My.Hr/My.Hr.Common/My.Hr.Common.csproj @@ -6,6 +6,6 @@ true - + \ 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 10e78ed2..a745e8cf 100644 --- a/samples/My.Hr/My.Hr.Test/My.Hr.Test.csproj +++ b/samples/My.Hr/My.Hr.Test/My.Hr.Test.csproj @@ -32,7 +32,7 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive @@ -42,7 +42,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - + 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 60cf408b..a67e2b5a 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 01c67c44..a724b01e 100644 --- a/samples/MyEf.Hr/MyEf.Hr.Business/MyEf.Hr.Business.csproj +++ b/samples/MyEf.Hr/MyEf.Hr.Business/MyEf.Hr.Business.csproj @@ -6,10 +6,10 @@ latest - - - - + + + + diff --git a/samples/MyEf.Hr/MyEf.Hr.Common/Agents/Generated/EmployeeAgent.cs b/samples/MyEf.Hr/MyEf.Hr.Common/Agents/Generated/EmployeeAgent.cs index d93200eb..8cb496f5 100644 --- a/samples/MyEf.Hr/MyEf.Hr.Common/Agents/Generated/EmployeeAgent.cs +++ b/samples/MyEf.Hr/MyEf.Hr.Common/Agents/Generated/EmployeeAgent.cs @@ -7,45 +7,40 @@ namespace MyEf.Hr.Common.Agents; /// /// Provides the HTTP agent. /// -public partial class EmployeeAgent : TypedHttpClientBase, IEmployeeAgent +/// The underlying . +/// The optional . +/// The optional . +public partial class EmployeeAgent(HttpClient client, IJsonSerializer? jsonSerializer = null, CoreEx.ExecutionContext? executionContext = null) : TypedHttpClientBase(client, jsonSerializer, executionContext), IEmployeeAgent { - /// - /// Initializes a new instance of the class. - /// - /// The underlying . - /// The optional . - /// The optional . - public EmployeeAgent(HttpClient client, IJsonSerializer? jsonSerializer = null, CoreEx.ExecutionContext? executionContext = null) : base(client, jsonSerializer, executionContext) { } - /// public Task> GetAsync(Guid id, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) - => GetAsync("employees/{id}", requestOptions: requestOptions, args: HttpArgs.Create(new HttpArg("id", id)), cancellationToken: cancellationToken); + => GetAsync("employees/{id}", requestOptions, [new HttpArg("id", id)], cancellationToken); /// public Task> CreateAsync(Employee value, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) - => PostAsync("employees", value, requestOptions: requestOptions, cancellationToken: cancellationToken); + => PostAsync("employees", value, requestOptions, cancellationToken: cancellationToken); /// public Task> UpdateAsync(Employee value, Guid id, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) - => PutAsync("employees/{id}", value, requestOptions: requestOptions, args: HttpArgs.Create(new HttpArg("id", id)), cancellationToken: cancellationToken); + => PutAsync("employees/{id}", value, requestOptions, [new HttpArg("id", id)], cancellationToken); /// public Task> PatchAsync(HttpPatchOption patchOption, string value, Guid id, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) - => PatchAsync("employees/{id}", patchOption, value, requestOptions: requestOptions, args: HttpArgs.Create(new HttpArg("id", id)), cancellationToken: cancellationToken); + => PatchAsync("employees/{id}", patchOption, value, requestOptions, [new HttpArg("id", id)], cancellationToken); /// public Task DeleteAsync(Guid id, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) - => DeleteAsync("employees/{id}", requestOptions: requestOptions, args: HttpArgs.Create(new HttpArg("id", id)), cancellationToken: cancellationToken); + => DeleteAsync("employees/{id}", requestOptions, [new HttpArg("id", id)], cancellationToken); /// public Task> GetByArgsAsync(EmployeeArgs? args, PagingArgs? paging = null, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) - => GetAsync("employees", requestOptions: requestOptions.IncludePaging(paging), args: HttpArgs.Create(new HttpArg("args", args, HttpArgType.FromUriUseProperties)), cancellationToken: cancellationToken); + => GetAsync("employees", requestOptions.IncludePaging(paging), [new HttpArg("args", args, HttpArgType.FromUriUseProperties)], cancellationToken); /// public Task> GetByQueryAsync(QueryArgs? query = null, PagingArgs? paging = null, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) - => GetAsync("employees/query", requestOptions: requestOptions.IncludeQuery(query).IncludePaging(paging), args: HttpArgs.Create(), cancellationToken: cancellationToken); + => GetAsync("employees/query", requestOptions: requestOptions.IncludeQuery(query).IncludePaging(paging), cancellationToken: cancellationToken); /// public Task> TerminateAsync(TerminationDetail value, Guid id, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) - => PostAsync("employees/{id}/terminate", value, requestOptions: requestOptions, args: HttpArgs.Create(new HttpArg("id", id)), cancellationToken: cancellationToken); + => PostAsync("employees/{id}/terminate", value, requestOptions, [new HttpArg("id", id)], cancellationToken); } \ No newline at end of file diff --git a/samples/MyEf.Hr/MyEf.Hr.Common/Agents/Generated/PerformanceReviewAgent.cs b/samples/MyEf.Hr/MyEf.Hr.Common/Agents/Generated/PerformanceReviewAgent.cs index 5434e5ac..5230f878 100644 --- a/samples/MyEf.Hr/MyEf.Hr.Common/Agents/Generated/PerformanceReviewAgent.cs +++ b/samples/MyEf.Hr/MyEf.Hr.Common/Agents/Generated/PerformanceReviewAgent.cs @@ -7,37 +7,32 @@ namespace MyEf.Hr.Common.Agents; /// /// Provides the HTTP agent. /// -public partial class PerformanceReviewAgent : TypedHttpClientBase, IPerformanceReviewAgent +/// The underlying . +/// The optional . +/// The optional . +public partial class PerformanceReviewAgent(HttpClient client, IJsonSerializer? jsonSerializer = null, CoreEx.ExecutionContext? executionContext = null) : TypedHttpClientBase(client, jsonSerializer, executionContext), IPerformanceReviewAgent { - /// - /// Initializes a new instance of the class. - /// - /// The underlying . - /// The optional . - /// The optional . - public PerformanceReviewAgent(HttpClient client, IJsonSerializer? jsonSerializer = null, CoreEx.ExecutionContext? executionContext = null) : base(client, jsonSerializer, executionContext) { } - /// public Task> GetAsync(Guid id, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) - => GetAsync("reviews/{id}", requestOptions: requestOptions, args: HttpArgs.Create(new HttpArg("id", id)), cancellationToken: cancellationToken); + => GetAsync("reviews/{id}", requestOptions, [new HttpArg("id", id)], cancellationToken); /// public Task> UpdateAsync(PerformanceReview value, Guid id, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) - => PutAsync("reviews/{id}", value, requestOptions: requestOptions, args: HttpArgs.Create(new HttpArg("id", id)), cancellationToken: cancellationToken); + => PutAsync("reviews/{id}", value, requestOptions, [new HttpArg("id", id)], cancellationToken); /// public Task> PatchAsync(HttpPatchOption patchOption, string value, Guid id, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) - => PatchAsync("reviews/{id}", patchOption, value, requestOptions: requestOptions, args: HttpArgs.Create(new HttpArg("id", id)), cancellationToken: cancellationToken); + => PatchAsync("reviews/{id}", patchOption, value, requestOptions, [new HttpArg("id", id)], cancellationToken); /// public Task DeleteAsync(Guid id, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) - => DeleteAsync("reviews/{id}", requestOptions: requestOptions, args: HttpArgs.Create(new HttpArg("id", id)), cancellationToken: cancellationToken); + => DeleteAsync("reviews/{id}", requestOptions, [new HttpArg("id", id)], cancellationToken); /// public Task> GetByEmployeeIdAsync(Guid employeeId, PagingArgs? paging = null, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) - => GetAsync("employees/{employeeId}/reviews", requestOptions: requestOptions.IncludePaging(paging), args: HttpArgs.Create(new HttpArg("employeeId", employeeId)), cancellationToken: cancellationToken); + => GetAsync("employees/{employeeId}/reviews", requestOptions.IncludePaging(paging), [new HttpArg("employeeId", employeeId)], cancellationToken); /// public Task> CreateAsync(PerformanceReview value, Guid employeeId, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) - => PostAsync("employees/{employeeId}/reviews", value, requestOptions: requestOptions, args: HttpArgs.Create(new HttpArg("employeeId", employeeId)), cancellationToken: cancellationToken); + => PostAsync("employees/{employeeId}/reviews", value, requestOptions, [new HttpArg("employeeId", employeeId)], cancellationToken); } \ No newline at end of file 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 8d77d825..a8cb2c56 100644 --- a/samples/MyEf.Hr/MyEf.Hr.Common/Agents/Generated/ReferenceDataAgent.cs +++ b/samples/MyEf.Hr/MyEf.Hr.Common/Agents/Generated/ReferenceDataAgent.cs @@ -7,35 +7,30 @@ namespace MyEf.Hr.Common.Agents; /// /// Provides the ReferenceData HTTP agent. /// -public partial class ReferenceDataAgent : TypedHttpClientBase, IReferenceDataAgent +/// The underlying . +/// The optional . +/// The optional . +public partial class ReferenceDataAgent(HttpClient client, IJsonSerializer? jsonSerializer = null, CoreEx.ExecutionContext? executionContext = null) : TypedHttpClientBase(client, jsonSerializer, executionContext), IReferenceDataAgent { - /// - /// Initializes a new instance of the class. - /// - /// The underlying . - /// The optional . - /// The optional . - public ReferenceDataAgent(HttpClient client, IJsonSerializer? jsonSerializer = null, CoreEx.ExecutionContext? executionContext = null) : base(client, jsonSerializer, executionContext) { } - /// 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); + => GetAsync("ref/genders", requestOptions, [new HttpArg("args", args, HttpArgType.FromUriUseProperties)], cancellationToken); /// 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); + => GetAsync("ref/terminationreasons", requestOptions, [new HttpArg("args", args, HttpArgType.FromUriUseProperties)], cancellationToken); /// 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); + => GetAsync("ref/relationshiptypes", requestOptions, [new HttpArg("args", args, HttpArgType.FromUriUseProperties)], cancellationToken); /// 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); + => GetAsync("ref/usstates", requestOptions, [new HttpArg("args", args, HttpArgType.FromUriUseProperties)], cancellationToken); /// 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); + => GetAsync("ref/performanceoutcomes", requestOptions, [new HttpArg("args", args, HttpArgType.FromUriUseProperties)], cancellationToken); /// public Task GetNamedAsync(string[] names, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) 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 0f01e8fb..5628145b 100644 --- a/samples/MyEf.Hr/MyEf.Hr.Common/MyEf.Hr.Common.csproj +++ b/samples/MyEf.Hr/MyEf.Hr.Common/MyEf.Hr.Common.csproj @@ -7,6 +7,6 @@ true - + \ 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 2a54296f..97c6b2f3 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 @@ -15,8 +15,8 @@ - - + + diff --git a/samples/MyEf.Hr/MyEf.Hr.Security.Subscriptions/OktaHttpClient.cs b/samples/MyEf.Hr/MyEf.Hr.Security.Subscriptions/OktaHttpClient.cs index 73799b21..87508937 100644 --- a/samples/MyEf.Hr/MyEf.Hr.Security.Subscriptions/OktaHttpClient.cs +++ b/samples/MyEf.Hr/MyEf.Hr.Security.Subscriptions/OktaHttpClient.cs @@ -2,12 +2,7 @@ public class OktaHttpClient : TypedHttpClientBase { - public OktaHttpClient(HttpClient client, SecuritySettings settings, IJsonSerializer? jsonSerializer = null, CoreEx.ExecutionContext? executionContext = null) - : base(client, jsonSerializer, executionContext) - { - Client.BaseAddress = new Uri(settings.OktaHttpClientBaseUri); - DefaultOptions.EnsureSuccess().ThrowKnownException(); - } + public OktaHttpClient(HttpClient client) : base(client) => DefaultOptions.EnsureSuccess().ThrowKnownException(); /// /// Gets the identifier for the email (see ). diff --git a/samples/MyEf.Hr/MyEf.Hr.Security.Subscriptions/Startup.cs b/samples/MyEf.Hr/MyEf.Hr.Security.Subscriptions/Startup.cs index a9baa38b..a787363b 100644 --- a/samples/MyEf.Hr/MyEf.Hr.Security.Subscriptions/Startup.cs +++ b/samples/MyEf.Hr/MyEf.Hr.Security.Subscriptions/Startup.cs @@ -30,6 +30,10 @@ public override void ConfigureServices(IServiceCollection services) { o.EventDataDeserializationErrorHandling = ErrorHandling.HandleBySubscriber; }) - .AddTypedHttpClient("OktaApi").AddTransientHttpErrorPolicy(policy => policy.WaitAndRetryAsync(retryCount: 3, retryAttempt => TimeSpan.FromSeconds(Math.Pow(2, retryAttempt)))); ; + .AddTypedHttpClient("OktaApi", (sp, hc) => + { + var settings = sp.GetRequiredService(); + hc.BaseAddress = new Uri(settings.OktaHttpClientBaseUri); + }).AddTransientHttpErrorPolicy(policy => policy.WaitAndRetryAsync(retryCount: 3, retryAttempt => TimeSpan.FromSeconds(Math.Pow(2, retryAttempt)))); } } \ No newline at end of file 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 9e4496bb..722b853c 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 @@ -27,7 +27,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 fa70106f..a276dc53 100644 --- a/samples/MyEf.Hr/MyEf.Hr.Test/MyEf.Hr.Test.csproj +++ b/samples/MyEf.Hr/MyEf.Hr.Test/MyEf.Hr.Test.csproj @@ -32,7 +32,7 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive @@ -42,7 +42,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/samples/MyEf.Hr/docs/10-Service-Bus-Subscribe.md b/samples/MyEf.Hr/docs/10-Service-Bus-Subscribe.md index 50bcc0fc..1495468f 100644 --- a/samples/MyEf.Hr/docs/10-Service-Bus-Subscribe.md +++ b/samples/MyEf.Hr/docs/10-Service-Bus-Subscribe.md @@ -149,7 +149,11 @@ The aforementioned services registration code of interest is as follows. { o.EventDataDeserializationErrorHandling = ErrorHandling.HandleBySubscriber; }) -.AddTypedHttpClient("OktaApi"); +.AddTypedHttpClient("OktaApi", (sp, hc) => +{ + var settings = sp.GetRequiredService(); + hc.BaseAddress = new Uri(settings.OktaHttpClientBaseUri); +}).AddTransientHttpErrorPolicy(policy => policy.WaitAndRetryAsync(retryCount: 3, retryAttempt => TimeSpan.FromSeconds(Math.Pow(2, retryAttempt)))); ```
@@ -252,12 +256,7 @@ namespace MyEf.Hr.Security.Subscriptions; public class OktaHttpClient : TypedHttpClientBase { - public OktaHttpClient(HttpClient client, SecuritySettings settings, IJsonSerializer? jsonSerializer = null, CoreEx.ExecutionContext? executionContext = null) - : base(client, jsonSerializer, executionContext) - { - Client.BaseAddress = new Uri(settings.OktaHttpClientBaseUri); - DefaultOptions.EnsureSuccess().ThrowKnownException(); - } + public OktaHttpClient(HttpClient client) : base(client) => DefaultOptions.EnsureSuccess().ThrowKnownException(); /// /// Gets the identifier for the email (see ). diff --git a/templates/Beef.Template.Solution/content/.template.config/template.json b/templates/Beef.Template.Solution/content/.template.config/template.json index 33ed3ef0..8d4ab85c 100644 --- a/templates/Beef.Template.Solution/content/.template.config/template.json +++ b/templates/Beef.Template.Solution/content/.template.config/template.json @@ -85,7 +85,7 @@ "type": "generated", "generator": "constant", "parameters": { - "value": "3.27.2" + "value": "3.27.3" }, "replaces": "CoreExVersion" }, diff --git a/tools/Beef.CodeGen.Core/Templates/EntityWebApiAgent_cs.hbs b/tools/Beef.CodeGen.Core/Templates/EntityWebApiAgent_cs.hbs index a60efd96..d349d547 100644 --- a/tools/Beef.CodeGen.Core/Templates/EntityWebApiAgent_cs.hbs +++ b/tools/Beef.CodeGen.Core/Templates/EntityWebApiAgent_cs.hbs @@ -13,20 +13,18 @@ namespace {{Root.NamespaceCommon}}.Agents; /// /// Provides the {{{EntityNameSeeComments}}} HTTP agent. /// -public partial class {{Name}}Agent : TypedHttpClientBase<{{Name}}Agent>, I{{Name}}Agent +/// The underlying . +/// The optional . +/// The optional . +public partial class {{Name}}Agent(HttpClient client, IJsonSerializer? jsonSerializer = null, CoreEx.ExecutionContext? executionContext = null) : TypedHttpClientBase<{{Name}}Agent>(client, jsonSerializer, executionContext), I{{Name}}Agent { - /// - /// Initializes a new instance of the class. - /// - /// The underlying . - /// The optional . - /// The optional . - public {{Name}}Agent(HttpClient client, IJsonSerializer? jsonSerializer = null, CoreEx.ExecutionContext? executionContext = null) : base(client, jsonSerializer, executionContext) { } {{#each WebApiAgentOperations}} + {{#unless @first}} + {{/unless}} /// public {{{AgentOperationTaskReturnType}}} {{Name}}Async({{#ifeq Type 'Patch'}}HttpPatchOption patchOption, {{/ifeq}}{{#each Parameters}}{{{WebApiAgentParameterType}}} {{ArgumentName}}{{#ifor IsPagingArgs IsQueryArgs}} = null{{/ifor}}, {{/each}}HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) - => {{AgentOperationHttpMethod}}("{{AgentWebApiRoute}}", {{#ifeq Type 'Patch'}}patchOption, {{/ifeq}}{{#if HasValue}}{{ValueParameter.ArgumentName}}, {{/if}}requestOptions: requestOptions{{#if Query}}.IncludeQuery(query){{/if}}{{#if Paging}}.IncludePaging(paging){{/if}}{{#ifne ValueLessParameters.Count 0}}, args: HttpArgs.Create({{#each CoreParameters}}{{#unless @first}}, {{/unless}}new HttpArg<{{{WebApiAgentParameterType}}}>("{{ArgumentName}}", {{ArgumentName}}{{#ifval WebApiAgentFrom}}, HttpArgType.{{WebApiAgentFrom}}{{/ifval}}){{/each}}){{/ifne}}, cancellationToken: cancellationToken); + => {{AgentOperationHttpMethod}}("{{AgentWebApiRoute}}", {{#ifeq Type 'Patch'}}patchOption, {{/ifeq}}{{#if HasValue}}{{ValueParameter.ArgumentName}}, {{else}}{{#ifeq CoreParameters.Count 0}}requestOptions: {{/ifeq}}{{/if}}requestOptions{{#if Query}}.IncludeQuery(query){{/if}}{{#if Paging}}.IncludePaging(paging){{/if}}{{#ifne CoreParameters.Count 0}}, [{{#each CoreParameters}}{{#unless @first}}, {{/unless}}new HttpArg<{{{WebApiAgentParameterType}}}>("{{ArgumentName}}", {{ArgumentName}}{{#ifval WebApiAgentFrom}}, HttpArgType.{{WebApiAgentFrom}}{{/ifval}}){{/each}}], cancellationToken{{else}}, cancellationToken: cancellationToken{{/ifne}}); {{/each}} }{{#if Root.PreprocessorDirectives}} diff --git a/tools/Beef.CodeGen.Core/Templates/ReferenceDataWebApiAgent_cs.hbs b/tools/Beef.CodeGen.Core/Templates/ReferenceDataWebApiAgent_cs.hbs index d18de2fa..2ddd10ad 100644 --- a/tools/Beef.CodeGen.Core/Templates/ReferenceDataWebApiAgent_cs.hbs +++ b/tools/Beef.CodeGen.Core/Templates/ReferenceDataWebApiAgent_cs.hbs @@ -12,20 +12,15 @@ namespace {{Root.NamespaceCommon}}.Agents; /// /// Provides the ReferenceData HTTP agent. /// -public partial class ReferenceDataAgent : TypedHttpClientBase, IReferenceDataAgent +/// The underlying . +/// The optional . +/// The optional . +public partial class ReferenceDataAgent(HttpClient client, IJsonSerializer? jsonSerializer = null, CoreEx.ExecutionContext? executionContext = null) : TypedHttpClientBase(client, jsonSerializer, executionContext), IReferenceDataAgent { - /// - /// Initializes a new instance of the class. - /// - /// The underlying . - /// The optional . - /// The optional . - public ReferenceDataAgent(HttpClient client, IJsonSerializer? jsonSerializer = null, CoreEx.ExecutionContext? executionContext = null) : base(client, jsonSerializer, executionContext) { } - {{#each RefDataEntities}} /// 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); + => GetAsync<{{RefDataQualifiedEntityCollectionName}}>("{{WebApiRoutePrefix}}", requestOptions, [new HttpArg("args", args, HttpArgType.FromUriUseProperties)], cancellationToken); {{/each}} /// diff --git a/tools/Beef.Database.Core/Beef.Database.Core.csproj b/tools/Beef.Database.Core/Beef.Database.Core.csproj index de5d4ecb..5b4cb38a 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 98502238..1057b0d4 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.Postgres/Beef.Database.Postgres.csproj b/tools/Beef.Database.Postgres/Beef.Database.Postgres.csproj index 5dee2f5b..1962be13 100644 --- a/tools/Beef.Database.Postgres/Beef.Database.Postgres.csproj +++ b/tools/Beef.Database.Postgres/Beef.Database.Postgres.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 58887e56..5089faa0 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 300ae84e..4e901fa9 100644 --- a/tools/Beef.Test.NUnit/Beef.Test.NUnit.csproj +++ b/tools/Beef.Test.NUnit/Beef.Test.NUnit.csproj @@ -8,7 +8,7 @@ - +