diff --git a/CHANGELOG.md b/CHANGELOG.md
index 7cbc1b9e9..a20787a4c 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,6 +2,11 @@
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.
+- *Fixed:* The database code-generation support for replacement is now optional (see new `Replace` property) versus always (defaults to `true`).
+
## v5.17.0
- *Enhancement:* The `Common`-project related code-generated artefacts have all been updated to leverage `global using` and file scoped namespace declarations.
- A new [`GlobalUsings.cs`](./templates/Beef.Template.Solution/content/Company.AppName.Common/GlobalUsings.cs) will need to be manually added to existing `Common` projects to enable; see [this](./templates/Beef.Template.Solution/content/Company.AppName.Common/GlobalUsings.cs) for an example and alter the last two namespaces accordingly.
diff --git a/Common.targets b/Common.targets
index 8d377acea..15e9c25a9 100644
--- a/Common.targets
+++ b/Common.targets
@@ -1,6 +1,6 @@
- 5.17.0
+ 5.17.1
preview
Avanade
Avanade
diff --git a/docs/Database-Query-Config.md b/docs/Database-Query-Config.md
index dc927828f..01c063ba3 100644
--- a/docs/Database-Query-Config.md
+++ b/docs/Database-Query-Config.md
@@ -46,6 +46,7 @@ Property | Description
**`name`** | The name of the primary table of the query. [Mandatory]
`schema` | The schema name of the primary table of the view.
† Defaults to `CodeGeneration.Schema`.
`alias` | The `Schema.Table` alias name.
† Will automatically default where not specified.
+`viewReplace` | Indicates whether the existing `View` database object should be replaced/altered or whether the object is dropped and recreated.
† Defaults to `CodeGeneration.Replace`.
diff --git a/docs/Database-StoredProcedure-Config.md b/docs/Database-StoredProcedure-Config.md
index 79f4f8d8c..534c80e37 100644
--- a/docs/Database-StoredProcedure-Config.md
+++ b/docs/Database-StoredProcedure-Config.md
@@ -66,6 +66,7 @@ Property | Description
**`type`** | The stored procedure operation type. Valid options are: `Get`, `GetColl`, `Create`, `Update`, `Upsert`, `Delete`, `Merge`.
† Defaults to `GetColl`.
**`paging`** | Indicates whether standardized paging support should be added.
† This only applies where the stored procedure operation `Type` is `GetColl`.
`storedProcedureName` | The `StoredProcedure` name in the database.
† Defaults to `sp` + `Table.Name` + `Name`; e.g. `spTableName` or `spPersonGet`.
+`replace` | Indicates whether the existing `StoredProcedure` database object should be replaced/altered or whether the object is dropped and recreated.
† Defaults to `CodeGeneration.Replace`.
diff --git a/docs/Database-Table-Config.md b/docs/Database-Table-Config.md
index beabec95f..d2d2c57d9 100644
--- a/docs/Database-Table-Config.md
+++ b/docs/Database-Table-Config.md
@@ -63,6 +63,7 @@ Property | Description
**`name`** | The name of the `Table` in the database. [Mandatory]
**`schema`** | The name of the `Schema` where the `Table` is defined in the database.
† Defaults to `CodeGeneration.Schema`.
`alias` | The `Schema.Table` alias name.
† Will automatically default where not specified.
+`replace` | Indicates whether the existing database object should be replaced/altered or whether the object is dropped and recreated.
† Defaults to `CodeGeneration.Replace`.
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 743fc8bcf..bd88762fc 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 9fa8d17c5..f5ee3356a 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 454c9cd07..59cb9cb7a 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 877fb7d7f..e3f491501 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 2b21ac33c..c6bbe9973 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 ac6240eab..d1ff3b430 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 947fa8095..be08da648 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/Cdr.Banking/Cdr.Banking.Test/FixtureSetup.cs b/samples/Cdr.Banking/Cdr.Banking.Test/FixtureSetup.cs
index 1811e6354..46ab9ee1f 100644
--- a/samples/Cdr.Banking/Cdr.Banking.Test/FixtureSetup.cs
+++ b/samples/Cdr.Banking/Cdr.Banking.Test/FixtureSetup.cs
@@ -26,7 +26,9 @@ public void OneTimeSetUp()
if (count == 0)
{
using var test = ApiTester.Create();
- _cosmosDb = test.Services.GetRequiredService();
+ using var scope = test.Services.CreateScope();
+
+ _cosmosDb = scope.ServiceProvider.GetRequiredService();
await _cosmosDb.Database.Client.CreateDatabaseIfNotExistsAsync(_cosmosDb.Database.Id, cancellationToken: ct).ConfigureAwait(false);
diff --git a/samples/Demo/Beef.Demo.Api/Beef.Demo.Api.csproj b/samples/Demo/Beef.Demo.Api/Beef.Demo.Api.csproj
index e14b3bc6f..ecbe0025c 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 f2f4e055d..1887a2ba1 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 e85c9ca09..4e164c212 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 d8b4ae2cc..24b05d5b3 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 092d2b951..8b4a3650e 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 7765782c2..273c6ac16 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 27a2549de..e16493942 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);
///