diff --git a/CHANGELOG.md b/CHANGELOG.md index d8745defd..7cbc1b9e9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,11 @@ Represents the **NuGet** versions. +## 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. + - The `*.Common.csproj` will need to be manually updated to include `Preview` and `true`. + ## v5.16.2 - *Fixed:* `Operation.AuthEntity` and `Operation.AuthOperation` updated to code-gen the `Manager`-based authorization (`ExecutionContent.UserIsAuthorized`) invocation. - *Fixed:* Code-generation logging/auditing of endpoints updated to also include the authorization configuration. diff --git a/Common.targets b/Common.targets index a55ce5c00..8d377acea 100644 --- a/Common.targets +++ b/Common.targets @@ -1,6 +1,6 @@ - 5.16.2 + 5.17.0 preview Avanade Avanade diff --git a/docs/Entity-CodeGeneration-Config.md b/docs/Entity-CodeGeneration-Config.md index 0a591004a..151e953af 100644 --- a/docs/Entity-CodeGeneration-Config.md +++ b/docs/Entity-CodeGeneration-Config.md @@ -35,8 +35,9 @@ Category | Description [`OData`](#OData) | Provides the _OData Data-layer_ configuration. [`HttpAgent`](#HttpAgent) | Provides the _HTTP Agent Data-layer_ configuration. [`gRPC`](#gRPC) | Provides the _gRPC_ configuration. -[`Path`](#Path) | Provides the _Path (Directory)_ configuration for the generated artefacts. -[`Namespace`](#Namespace) | Provides the _.NET Namespace_ configuration for the generated artefacts. +[`Path`](#Path) | Provides the _Path (Directory)_ configuration. +[`Namespace`](#Namespace) | Provides the _.NET Namespace_ configuration. +[`Auth`](#Auth) | Provides the _Authorization_ configuration. [`Collections`](#Collections) | Provides related child (hierarchical) configuration. The properties with a bold name are those that are more typically used (considered more important). @@ -188,7 +189,7 @@ Property | Description
## Path -Provides the _Path (Directory)_ configuration for the generated artefacts. +Provides the _Path (Directory)_ configuration. Property | Description -|- @@ -200,7 +201,7 @@ Property | Description
## Namespace -Provides the _.NET Namespace_ configuration for the generated artefacts. +Provides the _.NET Namespace_ configuration. Property | Description -|- @@ -211,6 +212,18 @@ Property | Description
+## Auth +Provides the _Authorization_ configuration. + +Property | Description +-|- +`authActionCreate` | The default `Operation.AuthAction` for an `Operation.Type` of `Create`.
† Defaults to `Create`. +`authActionRead` | The default `Operation.AuthAction` for an `Operation.Type` of `Get` or `GetColl`.
† Defaults to `Read`. +`authActionUpdate` | The default `Operation.AuthAction` for an `Operation.Type` of `Update`.
† Defaults to `Update`. +`authActionDelete` | The default `Operation.AuthAction` for an `Operation.Type` of `Delete`.
† Defaults to `Delete`. + +
+ ## Collections Provides related child (hierarchical) configuration. diff --git a/samples/Cdr.Banking/Cdr.Banking.Business/Data/Model/Generated/Account.cs b/samples/Cdr.Banking/Cdr.Banking.Business/Data/Model/Generated/Account.cs index d0ce25cb4..f2bfa22b7 100644 --- a/samples/Cdr.Banking/Cdr.Banking.Business/Data/Model/Generated/Account.cs +++ b/samples/Cdr.Banking/Cdr.Banking.Business/Data/Model/Generated/Account.cs @@ -2,91 +2,90 @@ * This file is automatically generated; any changes will be lost. */ -namespace Cdr.Banking.Business.Data.Model +namespace Cdr.Banking.Business.Data.Model; + +/// +/// Represents the Account model for data persistence model. +/// +public partial class Account : IIdentifier { /// - /// Represents the Account model for data persistence model. - /// - public partial class Account : IIdentifier - { - /// - /// Gets or sets the identifier. - /// - public string? Id { get; set; } - - /// - /// Gets or sets the Creation Date. - /// - public DateTime CreationDate { get; set; } - - /// - /// Gets or sets the Display Name. - /// - public string? DisplayName { get; set; } - - /// - /// Gets or sets the Nickname. - /// - public string? Nickname { get; set; } - - /// - /// Gets or sets the Open Status. - /// - public string? OpenStatus { get; set; } - - /// - /// Indicates whether Is Owned. - /// - public bool IsOwned { get; set; } - - /// - /// Gets or sets the Masked Number. - /// - public string? MaskedNumber { get; set; } - - /// - /// Gets or sets the Product Category. - /// - public string? ProductCategory { get; set; } - - /// - /// Gets or sets the Product Name. - /// - public string? ProductName { get; set; } - - /// - /// Gets or sets the Bsb. - /// - public string? Bsb { get; set; } - - /// - /// Gets or sets the Account Number. - /// - public string? AccountNumber { get; set; } - - /// - /// Gets or sets the Bundle Name. - /// - public string? BundleName { get; set; } - - /// - /// Gets or sets the Specific Account U Type. - /// - public string? SpecificAccountUType { get; set; } - - /// - /// Gets or sets the Term Deposit. - /// - public TermDepositAccount? TermDeposit { get; set; } - - /// - /// Gets or sets the Credit Card. - /// - public CreditCardAccount? CreditCard { get; set; } - - /// - /// Gets or sets the Balance. - /// - public Balance? Balance { get; set; } - } -} \ No newline at end of file + /// Gets or sets the identifier. + /// + public string? Id { get; set; } + + /// + /// Gets or sets the Creation Date. + /// + public DateTime CreationDate { get; set; } + + /// + /// Gets or sets the Display Name. + /// + public string? DisplayName { get; set; } + + /// + /// Gets or sets the Nickname. + /// + public string? Nickname { get; set; } + + /// + /// Gets or sets the Open Status. + /// + public string? OpenStatus { get; set; } + + /// + /// Indicates whether Is Owned. + /// + public bool IsOwned { get; set; } + + /// + /// Gets or sets the Masked Number. + /// + public string? MaskedNumber { get; set; } + + /// + /// Gets or sets the Product Category. + /// + public string? ProductCategory { get; set; } + + /// + /// Gets or sets the Product Name. + /// + public string? ProductName { get; set; } + + /// + /// Gets or sets the Bsb. + /// + public string? Bsb { get; set; } + + /// + /// Gets or sets the Account Number. + /// + public string? AccountNumber { get; set; } + + /// + /// Gets or sets the Bundle Name. + /// + public string? BundleName { get; set; } + + /// + /// Gets or sets the Specific Account U Type. + /// + public string? SpecificAccountUType { get; set; } + + /// + /// Gets or sets the Term Deposit. + /// + public TermDepositAccount? TermDeposit { get; set; } + + /// + /// Gets or sets the Credit Card. + /// + public CreditCardAccount? CreditCard { get; set; } + + /// + /// Gets or sets the Balance. + /// + public Balance? Balance { get; set; } +} diff --git a/samples/Cdr.Banking/Cdr.Banking.Business/Data/Model/Generated/AccountUType.cs b/samples/Cdr.Banking/Cdr.Banking.Business/Data/Model/Generated/AccountUType.cs index 1dac4412a..c1f8c6f16 100644 --- a/samples/Cdr.Banking/Cdr.Banking.Business/Data/Model/Generated/AccountUType.cs +++ b/samples/Cdr.Banking/Cdr.Banking.Business/Data/Model/Generated/AccountUType.cs @@ -2,15 +2,14 @@ * This file is automatically generated; any changes will be lost. */ -namespace Cdr.Banking.Business.Data.Model -{ - /// - /// Represents the Account U Type model. - /// - public partial class AccountUType : ReferenceDataBase { } +namespace Cdr.Banking.Business.Data.Model; - /// - /// Represents the collection. - /// - public partial class AccountUTypeCollection : List { } -} \ No newline at end of file +/// +/// Represents the Account U Type model. +/// +public partial class AccountUType : ReferenceDataBase { } + +/// +/// Represents the collection. +/// +public partial class AccountUTypeCollection : List { } diff --git a/samples/Cdr.Banking/Cdr.Banking.Business/Data/Model/Generated/Balance.cs b/samples/Cdr.Banking/Cdr.Banking.Business/Data/Model/Generated/Balance.cs index e47768739..99a3c1575 100644 --- a/samples/Cdr.Banking/Cdr.Banking.Business/Data/Model/Generated/Balance.cs +++ b/samples/Cdr.Banking/Cdr.Banking.Business/Data/Model/Generated/Balance.cs @@ -2,41 +2,40 @@ * This file is automatically generated; any changes will be lost. */ -namespace Cdr.Banking.Business.Data.Model +namespace Cdr.Banking.Business.Data.Model; + +/// +/// Represents the Balance model. +/// +public partial class Balance { /// - /// Represents the Balance model. + /// Gets or sets the Current Balance. /// - public partial class Balance - { - /// - /// Gets or sets the Current Balance. - /// - public decimal CurrentBalance { get; set; } + public decimal CurrentBalance { get; set; } - /// - /// Gets or sets the Available Balance. - /// - public decimal AvailableBalance { get; set; } + /// + /// Gets or sets the Available Balance. + /// + public decimal AvailableBalance { get; set; } - /// - /// Gets or sets the Credit Limit. - /// - public decimal CreditLimit { get; set; } + /// + /// Gets or sets the Credit Limit. + /// + public decimal CreditLimit { get; set; } - /// - /// Gets or sets the Amortised Limit. - /// - public decimal AmortisedLimit { get; set; } + /// + /// Gets or sets the Amortised Limit. + /// + public decimal AmortisedLimit { get; set; } - /// - /// Gets or sets the Currency. - /// - public string? Currency { get; set; } + /// + /// Gets or sets the Currency. + /// + public string? Currency { get; set; } - /// - /// Gets or sets the Purses. - /// - public BalancePurseCollection? Purses { get; set; } - } -} \ No newline at end of file + /// + /// Gets or sets the Purses. + /// + public BalancePurseCollection? Purses { get; set; } +} diff --git a/samples/Cdr.Banking/Cdr.Banking.Business/Data/Model/Generated/BalancePurse.cs b/samples/Cdr.Banking/Cdr.Banking.Business/Data/Model/Generated/BalancePurse.cs index 3f21503ae..746957735 100644 --- a/samples/Cdr.Banking/Cdr.Banking.Business/Data/Model/Generated/BalancePurse.cs +++ b/samples/Cdr.Banking/Cdr.Banking.Business/Data/Model/Generated/BalancePurse.cs @@ -2,26 +2,25 @@ * This file is automatically generated; any changes will be lost. */ -namespace Cdr.Banking.Business.Data.Model +namespace Cdr.Banking.Business.Data.Model; + +/// +/// Represents the Purse model. +/// +public partial class BalancePurse { /// - /// Represents the Purse model. + /// Gets or sets the Amount. /// - public partial class BalancePurse - { - /// - /// Gets or sets the Amount. - /// - public decimal Amount { get; set; } - - /// - /// Gets or sets the Currency. - /// - public string? Currency { get; set; } - } + public decimal Amount { get; set; } /// - /// Represents the collection. + /// Gets or sets the Currency. /// - public partial class BalancePurseCollection : List { } -} \ No newline at end of file + public string? Currency { get; set; } +} + +/// +/// Represents the collection. +/// +public partial class BalancePurseCollection : List { } diff --git a/samples/Cdr.Banking/Cdr.Banking.Business/Data/Model/Generated/CreditCardAccount.cs b/samples/Cdr.Banking/Cdr.Banking.Business/Data/Model/Generated/CreditCardAccount.cs index f49d6e3cb..b1d4f0471 100644 --- a/samples/Cdr.Banking/Cdr.Banking.Business/Data/Model/Generated/CreditCardAccount.cs +++ b/samples/Cdr.Banking/Cdr.Banking.Business/Data/Model/Generated/CreditCardAccount.cs @@ -2,31 +2,30 @@ * This file is automatically generated; any changes will be lost. */ -namespace Cdr.Banking.Business.Data.Model +namespace Cdr.Banking.Business.Data.Model; + +/// +/// Represents the Credit Card Account model. +/// +public partial class CreditCardAccount { /// - /// Represents the Credit Card Account model. + /// Gets or sets the Min Payment Amount. /// - public partial class CreditCardAccount - { - /// - /// Gets or sets the Min Payment Amount. - /// - public decimal MinPaymentAmount { get; set; } + public decimal MinPaymentAmount { get; set; } - /// - /// Gets or sets the Payment Due Amount. - /// - public decimal PaymentDueAmount { get; set; } + /// + /// Gets or sets the Payment Due Amount. + /// + public decimal PaymentDueAmount { get; set; } - /// - /// Gets or sets the Payment Currency. - /// - public string? PaymentCurrency { get; set; } + /// + /// Gets or sets the Payment Currency. + /// + public string? PaymentCurrency { get; set; } - /// - /// Gets or sets the Payment Due Date. - /// - public DateTime PaymentDueDate { get; set; } - } -} \ No newline at end of file + /// + /// Gets or sets the Payment Due Date. + /// + public DateTime PaymentDueDate { get; set; } +} diff --git a/samples/Cdr.Banking/Cdr.Banking.Business/Data/Model/Generated/MaturityInstructions.cs b/samples/Cdr.Banking/Cdr.Banking.Business/Data/Model/Generated/MaturityInstructions.cs index ff0a2b6e4..fa9718228 100644 --- a/samples/Cdr.Banking/Cdr.Banking.Business/Data/Model/Generated/MaturityInstructions.cs +++ b/samples/Cdr.Banking/Cdr.Banking.Business/Data/Model/Generated/MaturityInstructions.cs @@ -2,15 +2,14 @@ * This file is automatically generated; any changes will be lost. */ -namespace Cdr.Banking.Business.Data.Model -{ - /// - /// Represents the Maturity Instructions model. - /// - public partial class MaturityInstructions : ReferenceDataBase { } +namespace Cdr.Banking.Business.Data.Model; - /// - /// Represents the collection. - /// - public partial class MaturityInstructionsCollection : List { } -} \ No newline at end of file +/// +/// Represents the Maturity Instructions model. +/// +public partial class MaturityInstructions : ReferenceDataBase { } + +/// +/// Represents the collection. +/// +public partial class MaturityInstructionsCollection : List { } diff --git a/samples/Cdr.Banking/Cdr.Banking.Business/Data/Model/Generated/OpenStatus.cs b/samples/Cdr.Banking/Cdr.Banking.Business/Data/Model/Generated/OpenStatus.cs index 2b28a3277..da73c0c30 100644 --- a/samples/Cdr.Banking/Cdr.Banking.Business/Data/Model/Generated/OpenStatus.cs +++ b/samples/Cdr.Banking/Cdr.Banking.Business/Data/Model/Generated/OpenStatus.cs @@ -2,15 +2,14 @@ * This file is automatically generated; any changes will be lost. */ -namespace Cdr.Banking.Business.Data.Model -{ - /// - /// Represents the Open Status model. - /// - public partial class OpenStatus : ReferenceDataBase { } +namespace Cdr.Banking.Business.Data.Model; - /// - /// Represents the collection. - /// - public partial class OpenStatusCollection : List { } -} \ No newline at end of file +/// +/// Represents the Open Status model. +/// +public partial class OpenStatus : ReferenceDataBase { } + +/// +/// Represents the collection. +/// +public partial class OpenStatusCollection : List { } diff --git a/samples/Cdr.Banking/Cdr.Banking.Business/Data/Model/Generated/ProductCategory.cs b/samples/Cdr.Banking/Cdr.Banking.Business/Data/Model/Generated/ProductCategory.cs index 51ab1f4d6..3cf1cdc44 100644 --- a/samples/Cdr.Banking/Cdr.Banking.Business/Data/Model/Generated/ProductCategory.cs +++ b/samples/Cdr.Banking/Cdr.Banking.Business/Data/Model/Generated/ProductCategory.cs @@ -2,15 +2,14 @@ * This file is automatically generated; any changes will be lost. */ -namespace Cdr.Banking.Business.Data.Model -{ - /// - /// Represents the Product Category model. - /// - public partial class ProductCategory : ReferenceDataBase { } +namespace Cdr.Banking.Business.Data.Model; - /// - /// Represents the collection. - /// - public partial class ProductCategoryCollection : List { } -} \ No newline at end of file +/// +/// Represents the Product Category model. +/// +public partial class ProductCategory : ReferenceDataBase { } + +/// +/// Represents the collection. +/// +public partial class ProductCategoryCollection : List { } diff --git a/samples/Cdr.Banking/Cdr.Banking.Business/Data/Model/Generated/TermDepositAccount.cs b/samples/Cdr.Banking/Cdr.Banking.Business/Data/Model/Generated/TermDepositAccount.cs index 585988a6c..2346fce10 100644 --- a/samples/Cdr.Banking/Cdr.Banking.Business/Data/Model/Generated/TermDepositAccount.cs +++ b/samples/Cdr.Banking/Cdr.Banking.Business/Data/Model/Generated/TermDepositAccount.cs @@ -2,36 +2,35 @@ * This file is automatically generated; any changes will be lost. */ -namespace Cdr.Banking.Business.Data.Model +namespace Cdr.Banking.Business.Data.Model; + +/// +/// Represents the Term Deposit Account model. +/// +public partial class TermDepositAccount { /// - /// Represents the Term Deposit Account model. + /// Gets or sets the Lodgement Date. /// - public partial class TermDepositAccount - { - /// - /// Gets or sets the Lodgement Date. - /// - public DateTime LodgementDate { get; set; } + public DateTime LodgementDate { get; set; } - /// - /// Gets or sets the Maturity Date. - /// - public DateTime MaturityDate { get; set; } + /// + /// Gets or sets the Maturity Date. + /// + public DateTime MaturityDate { get; set; } - /// - /// Gets or sets the Maturity Amount. - /// - public decimal MaturityAmount { get; set; } + /// + /// Gets or sets the Maturity Amount. + /// + public decimal MaturityAmount { get; set; } - /// - /// Gets or sets the Maturity Currency. - /// - public string? MaturityCurrency { get; set; } + /// + /// Gets or sets the Maturity Currency. + /// + public string? MaturityCurrency { get; set; } - /// - /// Gets or sets the Maturity Instructions. - /// - public string? MaturityInstructions { get; set; } - } -} \ No newline at end of file + /// + /// Gets or sets the Maturity Instructions. + /// + public string? MaturityInstructions { get; set; } +} diff --git a/samples/Cdr.Banking/Cdr.Banking.Business/Data/Model/Generated/Transaction.cs b/samples/Cdr.Banking/Cdr.Banking.Business/Data/Model/Generated/Transaction.cs index e8f86f4a9..3b72ced50 100644 --- a/samples/Cdr.Banking/Cdr.Banking.Business/Data/Model/Generated/Transaction.cs +++ b/samples/Cdr.Banking/Cdr.Banking.Business/Data/Model/Generated/Transaction.cs @@ -2,96 +2,95 @@ * This file is automatically generated; any changes will be lost. */ -namespace Cdr.Banking.Business.Data.Model +namespace Cdr.Banking.Business.Data.Model; + +/// +/// Represents the Transaction model for data persistence model. +/// +public partial class Transaction : IIdentifier { /// - /// Represents the Transaction model for data persistence model. - /// - public partial class Transaction : IIdentifier - { - /// - /// Gets or sets the identifier. - /// - public string? Id { get; set; } - - /// - /// Gets or sets the Account Id. - /// - public string? AccountId { get; set; } - - /// - /// Indicates whether Is Detail Available. - /// - public bool IsDetailAvailable { get; set; } - - /// - /// Gets or sets the Type. - /// - public string? Type { get; set; } - - /// - /// Gets or sets the Status. - /// - public string? Status { get; set; } - - /// - /// Gets or sets the Description. - /// - public string? Description { get; set; } - - /// - /// Gets or sets the Posting Date Time. - /// - public DateTime PostingDateTime { get; set; } - - /// - /// Gets or sets the Execution Date Time. - /// - public DateTime ExecutionDateTime { get; set; } - - /// - /// Gets or sets the Amount. - /// - public decimal Amount { get; set; } - - /// - /// Gets or sets the Currency. - /// - public string? Currency { get; set; } - - /// - /// Gets or sets the Reference. - /// - public string? Reference { get; set; } - - /// - /// Gets or sets the Merchant Name. - /// - public string? MerchantName { get; set; } - - /// - /// Gets or sets the Merchant Category Code. - /// - public string? MerchantCategoryCode { get; set; } - - /// - /// Gets or sets the Biller Code. - /// - public string? BillerCode { get; set; } - - /// - /// Gets or sets the Biller Name. - /// - public string? BillerName { get; set; } - - /// - /// Gets or sets the Apca Number. - /// - public string? ApcaNumber { get; set; } - - /// - /// Gets or sets the Transaction Date Time. - /// - public DateTime TransactionDateTime { get; set; } - } -} \ No newline at end of file + /// Gets or sets the identifier. + /// + public string? Id { get; set; } + + /// + /// Gets or sets the Account Id. + /// + public string? AccountId { get; set; } + + /// + /// Indicates whether Is Detail Available. + /// + public bool IsDetailAvailable { get; set; } + + /// + /// Gets or sets the Type. + /// + public string? Type { get; set; } + + /// + /// Gets or sets the Status. + /// + public string? Status { get; set; } + + /// + /// Gets or sets the Description. + /// + public string? Description { get; set; } + + /// + /// Gets or sets the Posting Date Time. + /// + public DateTime PostingDateTime { get; set; } + + /// + /// Gets or sets the Execution Date Time. + /// + public DateTime ExecutionDateTime { get; set; } + + /// + /// Gets or sets the Amount. + /// + public decimal Amount { get; set; } + + /// + /// Gets or sets the Currency. + /// + public string? Currency { get; set; } + + /// + /// Gets or sets the Reference. + /// + public string? Reference { get; set; } + + /// + /// Gets or sets the Merchant Name. + /// + public string? MerchantName { get; set; } + + /// + /// Gets or sets the Merchant Category Code. + /// + public string? MerchantCategoryCode { get; set; } + + /// + /// Gets or sets the Biller Code. + /// + public string? BillerCode { get; set; } + + /// + /// Gets or sets the Biller Name. + /// + public string? BillerName { get; set; } + + /// + /// Gets or sets the Apca Number. + /// + public string? ApcaNumber { get; set; } + + /// + /// Gets or sets the Transaction Date Time. + /// + public DateTime TransactionDateTime { get; set; } +} diff --git a/samples/Cdr.Banking/Cdr.Banking.Business/Data/Model/Generated/TransactionStatus.cs b/samples/Cdr.Banking/Cdr.Banking.Business/Data/Model/Generated/TransactionStatus.cs index a0f37b4fb..43a75bbcf 100644 --- a/samples/Cdr.Banking/Cdr.Banking.Business/Data/Model/Generated/TransactionStatus.cs +++ b/samples/Cdr.Banking/Cdr.Banking.Business/Data/Model/Generated/TransactionStatus.cs @@ -2,15 +2,14 @@ * This file is automatically generated; any changes will be lost. */ -namespace Cdr.Banking.Business.Data.Model -{ - /// - /// Represents the Transaction Status model. - /// - public partial class TransactionStatus : ReferenceDataBase { } +namespace Cdr.Banking.Business.Data.Model; - /// - /// Represents the collection. - /// - public partial class TransactionStatusCollection : List { } -} \ No newline at end of file +/// +/// Represents the Transaction Status model. +/// +public partial class TransactionStatus : ReferenceDataBase { } + +/// +/// Represents the collection. +/// +public partial class TransactionStatusCollection : List { } diff --git a/samples/Cdr.Banking/Cdr.Banking.Business/Data/Model/Generated/TransactionType.cs b/samples/Cdr.Banking/Cdr.Banking.Business/Data/Model/Generated/TransactionType.cs index 4b02b86eb..693e0b642 100644 --- a/samples/Cdr.Banking/Cdr.Banking.Business/Data/Model/Generated/TransactionType.cs +++ b/samples/Cdr.Banking/Cdr.Banking.Business/Data/Model/Generated/TransactionType.cs @@ -2,15 +2,14 @@ * This file is automatically generated; any changes will be lost. */ -namespace Cdr.Banking.Business.Data.Model -{ - /// - /// Represents the Transaction Type model. - /// - public partial class TransactionType : ReferenceDataBase { } +namespace Cdr.Banking.Business.Data.Model; - /// - /// Represents the collection. - /// - public partial class TransactionTypeCollection : List { } -} \ No newline at end of file +/// +/// Represents the Transaction Type model. +/// +public partial class TransactionType : ReferenceDataBase { } + +/// +/// Represents the collection. +/// +public partial class TransactionTypeCollection : List { } 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 08ea97628..454c9cd07 100644 --- a/samples/Cdr.Banking/Cdr.Banking.Common/Agents/Generated/AccountAgent.cs +++ b/samples/Cdr.Banking/Cdr.Banking.Common/Agents/Generated/AccountAgent.cs @@ -2,50 +2,38 @@ * This file is automatically generated; any changes will be lost. */ -using System; -using System.Collections.Generic; -using System.Net.Http; -using System.Threading; -using System.Threading.Tasks; -using CoreEx.Entities; -using CoreEx.Http; -using CoreEx.Json; -using Cdr.Banking.Common.Entities; -using RefDataNamespace = Cdr.Banking.Common.Entities; +namespace Cdr.Banking.Common.Agents; -namespace Cdr.Banking.Common.Agents +/// +/// Provides the HTTP agent. +/// +public partial class AccountAgent : TypedHttpClientBase, IAccountAgent { /// - /// Provides the HTTP agent. + /// Initializes a new instance of the class. /// - public partial class AccountAgent : TypedHttpClientBase, 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) { } + /// 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); + /// + 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); - /// - 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); + /// + 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); - /// - 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); + /// + 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); - /// - 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); + /// + 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); - /// - 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); - } + /// + 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); } \ No newline at end of file diff --git a/samples/Cdr.Banking/Cdr.Banking.Common/Agents/Generated/IAccountAgent.cs b/samples/Cdr.Banking/Cdr.Banking.Common/Agents/Generated/IAccountAgent.cs index 6842fd6bc..c3a3d6f56 100644 --- a/samples/Cdr.Banking/Cdr.Banking.Common/Agents/Generated/IAccountAgent.cs +++ b/samples/Cdr.Banking/Cdr.Banking.Common/Agents/Generated/IAccountAgent.cs @@ -2,71 +2,57 @@ * This file is automatically generated; any changes will be lost. */ -using System; -using System.Collections.Generic; -using System.Net.Http; -using System.Threading; -using System.Threading.Tasks; -using CoreEx.Configuration; -using CoreEx.Entities; -using CoreEx.Http; -using CoreEx.Json; -using Microsoft.Extensions.Logging; -using Cdr.Banking.Common.Entities; -using RefDataNamespace = Cdr.Banking.Common.Entities; +namespace Cdr.Banking.Common.Agents; -namespace Cdr.Banking.Common.Agents +/// +/// Defines the HTTP agent. +/// +public partial interface IAccountAgent { /// - /// Defines the HTTP agent. + /// Get all accounts. /// - public partial interface IAccountAgent - { - /// - /// Get all accounts. - /// - /// The Args (see ). - /// The . - /// The optional . - /// The . - /// A . - Task> GetAccountsAsync(AccountArgs? args, PagingArgs? paging = null, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); + /// The Args (see ). + /// The . + /// The optional . + /// The . + /// A . + Task> GetAccountsAsync(AccountArgs? args, PagingArgs? paging = null, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); - /// - /// Get all accounts. - /// - /// The . - /// The . - /// The optional . - /// The . - /// A . - Task> GetAccountsQueryAsync(QueryArgs? query = null, PagingArgs? paging = null, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); + /// + /// Get all accounts. + /// + /// The . + /// The . + /// The optional . + /// The . + /// A . + Task> GetAccountsQueryAsync(QueryArgs? query = null, PagingArgs? paging = null, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); - /// - /// Get . - /// - /// The identifier. - /// The optional . - /// The . - /// A . - Task> GetDetailAsync(string? accountId, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); + /// + /// Get . + /// + /// The identifier. + /// The optional . + /// The . + /// A . + Task> GetDetailAsync(string? accountId, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); - /// - /// Get . - /// - /// The identifier. - /// The optional . - /// The . - /// A . - Task> GetBalanceAsync(string? accountId, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); + /// + /// Get . + /// + /// The identifier. + /// The optional . + /// The . + /// A . + Task> GetBalanceAsync(string? accountId, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); - /// - /// Get statement (file). - /// - /// The identifier. - /// The optional . - /// The . - /// A . - Task GetStatementAsync(string? accountId, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); - } + /// + /// Get statement (file). + /// + /// The identifier. + /// The optional . + /// The . + /// A . + Task GetStatementAsync(string? accountId, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); } \ No newline at end of file diff --git a/samples/Cdr.Banking/Cdr.Banking.Common/Agents/Generated/IReferenceDataAgent.cs b/samples/Cdr.Banking/Cdr.Banking.Common/Agents/Generated/IReferenceDataAgent.cs index 08baeeb3f..1ad06ef57 100644 --- a/samples/Cdr.Banking/Cdr.Banking.Common/Agents/Generated/IReferenceDataAgent.cs +++ b/samples/Cdr.Banking/Cdr.Banking.Common/Agents/Generated/IReferenceDataAgent.cs @@ -2,89 +2,74 @@ * This file is automatically generated; any changes will be lost. */ -using System; -using System.Collections.Generic; -using System.Net.Http; -using System.Threading; -using System.Threading.Tasks; -using CoreEx.Configuration; -using CoreEx.Entities; -using CoreEx.Http; -using CoreEx.Json; -using CoreEx.RefData; -using Microsoft.Extensions.Logging; -using Cdr.Banking.Common.Entities; -using RefDataNamespace = Cdr.Banking.Common.Entities; +namespace Cdr.Banking.Common.Agents; -namespace Cdr.Banking.Common.Agents +/// +/// Defines the ReferenceData HTTP agent. +/// +public partial interface IReferenceDataAgent { /// - /// Defines the ReferenceData HTTP agent. + /// Gets all of the items that match the filter arguments. /// - public partial interface IReferenceDataAgent - { - /// - /// Gets all of the items that match the filter arguments. - /// - /// The optional arguments. - /// The optional . - /// The . - /// A . - Task> OpenStatusGetAllAsync(ReferenceDataFilter? args = null, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); + /// The optional arguments. + /// The optional . + /// The . + /// A . + Task> OpenStatusGetAllAsync(ReferenceDataFilter? args = null, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); - /// - /// Gets all of the items that match the filter arguments. - /// - /// The optional arguments. - /// The optional . - /// The . - /// A . - Task> ProductCategoryGetAllAsync(ReferenceDataFilter? args = null, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); + /// + /// Gets all of the items that match the filter arguments. + /// + /// The optional arguments. + /// The optional . + /// The . + /// A . + Task> ProductCategoryGetAllAsync(ReferenceDataFilter? args = null, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); - /// - /// Gets all of the items that match the filter arguments. - /// - /// The optional arguments. - /// The optional . - /// The . - /// A . - Task> AccountUTypeGetAllAsync(ReferenceDataFilter? args = null, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); + /// + /// Gets all of the items that match the filter arguments. + /// + /// The optional arguments. + /// The optional . + /// The . + /// A . + Task> AccountUTypeGetAllAsync(ReferenceDataFilter? args = null, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); - /// - /// Gets all of the items that match the filter arguments. - /// - /// The optional arguments. - /// The optional . - /// The . - /// A . - Task> MaturityInstructionsGetAllAsync(ReferenceDataFilter? args = null, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); + /// + /// Gets all of the items that match the filter arguments. + /// + /// The optional arguments. + /// The optional . + /// The . + /// A . + Task> MaturityInstructionsGetAllAsync(ReferenceDataFilter? args = null, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); - /// - /// Gets all of the items that match the filter arguments. - /// - /// The optional arguments. - /// The optional . - /// The . - /// A . - Task> TransactionTypeGetAllAsync(ReferenceDataFilter? args = null, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); + /// + /// Gets all of the items that match the filter arguments. + /// + /// The optional arguments. + /// The optional . + /// The . + /// A . + Task> TransactionTypeGetAllAsync(ReferenceDataFilter? args = null, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); - /// - /// Gets all of the items that match the filter arguments. - /// - /// The optional arguments. - /// The optional . - /// The . - /// A . - Task> TransactionStatusGetAllAsync(ReferenceDataFilter? args = null, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); + /// + /// Gets all of the items that match the filter arguments. + /// + /// The optional arguments. + /// The optional . + /// The . + /// A . + Task> TransactionStatusGetAllAsync(ReferenceDataFilter? args = null, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); - /// - /// Gets the reference data entries for the specified entities and codes from the query string; e.g: api/v1/ref?entity=codeX,codeY&entity2=codeZ&entity3 - /// - /// The optional list of reference data names. - /// The optional . - /// The . - /// A . - /// The reference data objects will need to be manually extracted from the corresponding response content. - Task GetNamedAsync(string[] names, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); - } + /// + /// Gets the reference data entries for the specified entities and codes from the query string; e.g: api/v1/ref?entity=codeX,codeY&entity2=codeZ&entity3 + /// + /// The optional list of reference data names. + /// The optional . + /// The . + /// A . + /// The reference data objects will need to be manually extracted from the corresponding response content. + Task GetNamedAsync(string[] names, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); } \ No newline at end of file diff --git a/samples/Cdr.Banking/Cdr.Banking.Common/Agents/Generated/ITransactionAgent.cs b/samples/Cdr.Banking/Cdr.Banking.Common/Agents/Generated/ITransactionAgent.cs index 108593608..e52aa5f74 100644 --- a/samples/Cdr.Banking/Cdr.Banking.Common/Agents/Generated/ITransactionAgent.cs +++ b/samples/Cdr.Banking/Cdr.Banking.Common/Agents/Generated/ITransactionAgent.cs @@ -2,35 +2,21 @@ * This file is automatically generated; any changes will be lost. */ -using System; -using System.Collections.Generic; -using System.Net.Http; -using System.Threading; -using System.Threading.Tasks; -using CoreEx.Configuration; -using CoreEx.Entities; -using CoreEx.Http; -using CoreEx.Json; -using Microsoft.Extensions.Logging; -using Cdr.Banking.Common.Entities; -using RefDataNamespace = Cdr.Banking.Common.Entities; +namespace Cdr.Banking.Common.Agents; -namespace Cdr.Banking.Common.Agents +/// +/// Defines the HTTP agent. +/// +public partial interface ITransactionAgent { /// - /// Defines the HTTP agent. + /// Get transaction for account. /// - public partial interface ITransactionAgent - { - /// - /// Get transaction for account. - /// - /// The Account Id. - /// The Args (see ). - /// The . - /// The optional . - /// The . - /// A . - Task> GetTransactionsAsync(string? accountId, TransactionArgs? args, PagingArgs? paging = null, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); - } + /// The Account Id. + /// The Args (see ). + /// The . + /// The optional . + /// The . + /// A . + Task> GetTransactionsAsync(string? accountId, TransactionArgs? args, PagingArgs? paging = null, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); } \ 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 7b8d09c0e..877fb7d7f 100644 --- a/samples/Cdr.Banking/Cdr.Banking.Common/Agents/Generated/ReferenceDataAgent.cs +++ b/samples/Cdr.Banking/Cdr.Banking.Common/Agents/Generated/ReferenceDataAgent.cs @@ -2,65 +2,52 @@ * This file is automatically generated; any changes will be lost. */ -using System; -using System.Collections.Generic; -using System.Net.Http; -using System.Threading; -using System.Threading.Tasks; -using CoreEx.Entities; -using CoreEx.Http; -using CoreEx.Json; -using CoreEx.RefData; -using Cdr.Banking.Common.Entities; -using RefDataNamespace = Cdr.Banking.Common.Entities; +namespace Cdr.Banking.Common.Agents; -namespace Cdr.Banking.Common.Agents +/// +/// Provides the ReferenceData HTTP agent. +/// +public partial class ReferenceDataAgent : TypedHttpClientBase, IReferenceDataAgent { /// - /// Provides the ReferenceData HTTP agent. + /// Initializes a new instance of the class. /// - public partial class ReferenceDataAgent : TypedHttpClientBase, 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) { } + /// 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); + /// + 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); - /// - 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); + /// + 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); - /// - 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); + /// + 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); - /// - 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); + /// + 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); - /// - 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); + /// + 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); - /// - 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); + /// + 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); - /// - public Task GetNamedAsync(string[] names, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) - { - var ro = requestOptions ?? new HttpRequestOptions(); - if (names != null) - ro.UrlQueryString += string.Join("&", names); - - return GetAsync("api/v1/ref", ro, null, cancellationToken); - } + /// + public Task GetNamedAsync(string[] names, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) + { + var ro = requestOptions ?? new HttpRequestOptions(); + if (names != null) + ro.UrlQueryString += string.Join("&", names); + + return GetAsync("api/v1/ref", ro, null, cancellationToken); } } \ No newline at end of file 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 b2e3be7c8..2b21ac33c 100644 --- a/samples/Cdr.Banking/Cdr.Banking.Common/Agents/Generated/TransactionAgent.cs +++ b/samples/Cdr.Banking/Cdr.Banking.Common/Agents/Generated/TransactionAgent.cs @@ -2,34 +2,22 @@ * This file is automatically generated; any changes will be lost. */ -using System; -using System.Collections.Generic; -using System.Net.Http; -using System.Threading; -using System.Threading.Tasks; -using CoreEx.Entities; -using CoreEx.Http; -using CoreEx.Json; -using Cdr.Banking.Common.Entities; -using RefDataNamespace = Cdr.Banking.Common.Entities; +namespace Cdr.Banking.Common.Agents; -namespace Cdr.Banking.Common.Agents +/// +/// Provides the HTTP agent. +/// +public partial class TransactionAgent : TypedHttpClientBase, ITransactionAgent { /// - /// Provides the HTTP agent. + /// Initializes a new instance of the class. /// - public partial class TransactionAgent : TypedHttpClientBase, 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) { } + /// 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); - } + /// + 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); } \ 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 ecec905fd..ac6240eab 100644 --- a/samples/Cdr.Banking/Cdr.Banking.Common/Cdr.Banking.Common.csproj +++ b/samples/Cdr.Banking/Cdr.Banking.Common/Cdr.Banking.Common.csproj @@ -2,6 +2,8 @@ netstandard2.1 enable + Preview + true diff --git a/samples/Cdr.Banking/Cdr.Banking.Common/Entities/Generated/Account.cs b/samples/Cdr.Banking/Cdr.Banking.Common/Entities/Generated/Account.cs index 38366f6f1..9b737da68 100644 --- a/samples/Cdr.Banking/Cdr.Banking.Common/Entities/Generated/Account.cs +++ b/samples/Cdr.Banking/Cdr.Banking.Common/Entities/Generated/Account.cs @@ -2,92 +2,85 @@ * This file is automatically generated; any changes will be lost. */ -using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Text.Json.Serialization; -using CoreEx.Entities; +namespace Cdr.Banking.Common.Entities; -namespace Cdr.Banking.Common.Entities +/// +/// Represents the Account entity. +/// +public partial class Account : IIdentifier { /// - /// Represents the Account entity. + /// Gets or sets the identifier. /// - public partial class Account : IIdentifier - { - /// - /// Gets or sets the identifier. - /// - [JsonPropertyName("accountId")] - public string? Id { get; set; } + [JsonPropertyName("accountId")] + public string? Id { get; set; } - /// - /// Gets or sets the Creation Date. - /// - public DateTime CreationDate { get; set; } - - /// - /// Gets or sets the Display Name. - /// - public string? DisplayName { get; set; } + /// + /// Gets or sets the Creation Date. + /// + public DateTime CreationDate { get; set; } - /// - /// Gets or sets the Nickname. - /// - public string? Nickname { get; set; } + /// + /// Gets or sets the Display Name. + /// + public string? DisplayName { get; set; } - /// - /// Gets or sets the Open Status code. - /// - public string? OpenStatus { get; set; } + /// + /// Gets or sets the Nickname. + /// + public string? Nickname { get; set; } - /// - /// Indicates whether Is Owned. - /// - public bool IsOwned { get; set; } + /// + /// Gets or sets the Open Status code. + /// + public string? OpenStatus { get; set; } - /// - /// Gets or sets the Masked Number. - /// - public string? MaskedNumber { get; set; } + /// + /// Indicates whether Is Owned. + /// + public bool IsOwned { get; set; } - /// - /// Gets or sets the Product Category code. - /// - public string? ProductCategory { get; set; } + /// + /// Gets or sets the Masked Number. + /// + public string? MaskedNumber { get; set; } - /// - /// Gets or sets the Product Name. - /// - public string? ProductName { get; set; } - } + /// + /// Gets or sets the Product Category code. + /// + public string? ProductCategory { get; set; } /// - /// Represents the Account collection. + /// Gets or sets the Product Name. /// - public partial class AccountCollection : List { } + public string? ProductName { get; set; } +} + +/// +/// Represents the Account collection. +/// +public partial class AccountCollection : List { } +/// +/// Represents the Account collection result. +/// +public class AccountCollectionResult : CollectionResult +{ + /// + /// Initializes a new instance of the class. + /// + public AccountCollectionResult() { } + + /// + /// Initializes a new instance of the class with . + /// + /// The . + public AccountCollectionResult(PagingArgs? paging) : base(paging) { } + /// - /// Represents the Account collection result. + /// Initializes a new instance of the class with to add. /// - public class AccountCollectionResult : CollectionResult - { - /// - /// Initializes a new instance of the class. - /// - public AccountCollectionResult() { } - - /// - /// Initializes a new instance of the class with . - /// - /// The . - public AccountCollectionResult(PagingArgs? paging) : base(paging) { } - - /// - /// Initializes a new instance of the class with to add. - /// - /// The items to add. - /// The . - public AccountCollectionResult(IEnumerable items, PagingArgs? paging = null) : base(paging) => Items.AddRange(items); - } -} \ No newline at end of file + /// The items to add. + /// The . + public AccountCollectionResult(IEnumerable items, PagingArgs? paging = null) : base(paging) => Items.AddRange(items); +} diff --git a/samples/Cdr.Banking/Cdr.Banking.Common/Entities/Generated/AccountArgs.cs b/samples/Cdr.Banking/Cdr.Banking.Common/Entities/Generated/AccountArgs.cs index b013b7ebd..4ae6f748e 100644 --- a/samples/Cdr.Banking/Cdr.Banking.Common/Entities/Generated/AccountArgs.cs +++ b/samples/Cdr.Banking/Cdr.Banking.Common/Entities/Generated/AccountArgs.cs @@ -2,35 +2,28 @@ * This file is automatically generated; any changes will be lost. */ -using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Text.Json.Serialization; -using CoreEx.Entities; +namespace Cdr.Banking.Common.Entities; -namespace Cdr.Banking.Common.Entities +/// +/// Represents the Account arguments entity. +/// +public partial class AccountArgs { /// - /// Represents the Account arguments entity. + /// Gets or sets the Product Category code. /// - public partial class AccountArgs - { - /// - /// Gets or sets the Product Category code. - /// - [JsonPropertyName("product-category")] - public string? ProductCategory { get; set; } + [JsonPropertyName("product-category")] + public string? ProductCategory { get; set; } - /// - /// Gets or sets the Open Status code. - /// - [JsonPropertyName("open-status")] - public string? OpenStatus { get; set; } + /// + /// Gets or sets the Open Status code. + /// + [JsonPropertyName("open-status")] + public string? OpenStatus { get; set; } - /// - /// Indicates whether Is Owned. - /// - [JsonPropertyName("is-owned")] - public bool? IsOwned { get; set; } - } -} \ No newline at end of file + /// + /// Indicates whether Is Owned. + /// + [JsonPropertyName("is-owned")] + public bool? IsOwned { get; set; } +} diff --git a/samples/Cdr.Banking/Cdr.Banking.Common/Entities/Generated/AccountDetail.cs b/samples/Cdr.Banking/Cdr.Banking.Common/Entities/Generated/AccountDetail.cs index 8b1656ad2..12ed10370 100644 --- a/samples/Cdr.Banking/Cdr.Banking.Common/Entities/Generated/AccountDetail.cs +++ b/samples/Cdr.Banking/Cdr.Banking.Common/Entities/Generated/AccountDetail.cs @@ -2,47 +2,40 @@ * This file is automatically generated; any changes will be lost. */ -using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Text.Json.Serialization; -using CoreEx.Entities; +namespace Cdr.Banking.Common.Entities; -namespace Cdr.Banking.Common.Entities +/// +/// Represents the Account Detail entity. +/// +public partial class AccountDetail : Account { /// - /// Represents the Account Detail entity. + /// Gets or sets the Bsb. /// - public partial class AccountDetail : Account - { - /// - /// Gets or sets the Bsb. - /// - public string? Bsb { get; set; } + public string? Bsb { get; set; } - /// - /// Gets or sets the Account Number. - /// - public string? AccountNumber { get; set; } + /// + /// Gets or sets the Account Number. + /// + public string? AccountNumber { get; set; } - /// - /// Gets or sets the Bundle Name. - /// - public string? BundleName { get; set; } + /// + /// Gets or sets the Bundle Name. + /// + public string? BundleName { get; set; } - /// - /// Gets or sets the Specific Account U Type code. - /// - public string? SpecificAccountUType { get; set; } + /// + /// Gets or sets the Specific Account U Type code. + /// + public string? SpecificAccountUType { get; set; } - /// - /// Gets or sets the Term Deposit. - /// - public TermDepositAccount? TermDeposit { get; set; } + /// + /// Gets or sets the Term Deposit. + /// + public TermDepositAccount? TermDeposit { get; set; } - /// - /// Gets or sets the Credit Card. - /// - public CreditCardAccount? CreditCard { get; set; } - } -} \ No newline at end of file + /// + /// Gets or sets the Credit Card. + /// + public CreditCardAccount? CreditCard { get; set; } +} diff --git a/samples/Cdr.Banking/Cdr.Banking.Common/Entities/Generated/AccountUType.cs b/samples/Cdr.Banking/Cdr.Banking.Common/Entities/Generated/AccountUType.cs index e1519663f..2399dafda 100644 --- a/samples/Cdr.Banking/Cdr.Banking.Common/Entities/Generated/AccountUType.cs +++ b/samples/Cdr.Banking/Cdr.Banking.Common/Entities/Generated/AccountUType.cs @@ -2,22 +2,14 @@ * This file is automatically generated; any changes will be lost. */ -using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Text.Json.Serialization; -using CoreEx.Entities; -using CoreEx.RefData; +namespace Cdr.Banking.Common.Entities; -namespace Cdr.Banking.Common.Entities -{ - /// - /// Represents the Account U Type entity. - /// - public partial class AccountUType : ReferenceDataBase { } +/// +/// Represents the Account U Type entity. +/// +public partial class AccountUType : ReferenceDataBase { } - /// - /// Represents the AccountUType collection. - /// - public partial class AccountUTypeCollection : List { } -} \ No newline at end of file +/// +/// Represents the AccountUType collection. +/// +public partial class AccountUTypeCollection : List { } diff --git a/samples/Cdr.Banking/Cdr.Banking.Common/Entities/Generated/Balance.cs b/samples/Cdr.Banking/Cdr.Banking.Common/Entities/Generated/Balance.cs index a6a15bff3..8afbb4db3 100644 --- a/samples/Cdr.Banking/Cdr.Banking.Common/Entities/Generated/Balance.cs +++ b/samples/Cdr.Banking/Cdr.Banking.Common/Entities/Generated/Balance.cs @@ -2,55 +2,48 @@ * This file is automatically generated; any changes will be lost. */ -using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Text.Json.Serialization; -using CoreEx.Entities; +namespace Cdr.Banking.Common.Entities; -namespace Cdr.Banking.Common.Entities +/// +/// Represents the Balance entity. +/// +public partial class Balance : IIdentifier { /// - /// Represents the Balance entity. + /// Gets or sets the Account identifier. /// - public partial class Balance : IIdentifier - { - /// - /// Gets or sets the Account identifier. - /// - [JsonPropertyName("accountId")] - public string? Id { get; set; } - - /// - /// Gets or sets the Current Balance. - /// - [JsonIgnore(Condition = JsonIgnoreCondition.Never)] - public decimal CurrentBalance { get; set; } - - /// - /// Gets or sets the Available Balance. - /// - [JsonIgnore(Condition = JsonIgnoreCondition.Never)] - public decimal AvailableBalance { get; set; } - - /// - /// Gets or sets the Credit Limit. - /// - public decimal CreditLimit { get; set; } - - /// - /// Gets or sets the Amortised Limit. - /// - public decimal AmortisedLimit { get; set; } - - /// - /// Gets or sets the Currency. - /// - public string? Currency { get; set; } - - /// - /// Gets or sets the Purses. - /// - public BalancePurseCollection? Purses { get; set; } - } -} \ No newline at end of file + [JsonPropertyName("accountId")] + public string? Id { get; set; } + + /// + /// Gets or sets the Current Balance. + /// + [JsonIgnore(Condition = JsonIgnoreCondition.Never)] + public decimal CurrentBalance { get; set; } + + /// + /// Gets or sets the Available Balance. + /// + [JsonIgnore(Condition = JsonIgnoreCondition.Never)] + public decimal AvailableBalance { get; set; } + + /// + /// Gets or sets the Credit Limit. + /// + public decimal CreditLimit { get; set; } + + /// + /// Gets or sets the Amortised Limit. + /// + public decimal AmortisedLimit { get; set; } + + /// + /// Gets or sets the Currency. + /// + public string? Currency { get; set; } + + /// + /// Gets or sets the Purses. + /// + public BalancePurseCollection? Purses { get; set; } +} diff --git a/samples/Cdr.Banking/Cdr.Banking.Common/Entities/Generated/BalancePurse.cs b/samples/Cdr.Banking/Cdr.Banking.Common/Entities/Generated/BalancePurse.cs index 1a75eef82..d3d34fe50 100644 --- a/samples/Cdr.Banking/Cdr.Banking.Common/Entities/Generated/BalancePurse.cs +++ b/samples/Cdr.Banking/Cdr.Banking.Common/Entities/Generated/BalancePurse.cs @@ -2,32 +2,25 @@ * This file is automatically generated; any changes will be lost. */ -using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Text.Json.Serialization; -using CoreEx.Entities; +namespace Cdr.Banking.Common.Entities; -namespace Cdr.Banking.Common.Entities +/// +/// Represents the Balance Purse entity. +/// +public partial class BalancePurse { /// - /// Represents the Balance Purse entity. + /// Gets or sets the Amount. /// - public partial class BalancePurse - { - /// - /// Gets or sets the Amount. - /// - public decimal Amount { get; set; } - - /// - /// Gets or sets the Currency. - /// - public string? Currency { get; set; } - } + public decimal Amount { get; set; } /// - /// Represents the BalancePurse collection. + /// Gets or sets the Currency. /// - public partial class BalancePurseCollection : List { } -} \ No newline at end of file + public string? Currency { get; set; } +} + +/// +/// Represents the BalancePurse collection. +/// +public partial class BalancePurseCollection : List { } diff --git a/samples/Cdr.Banking/Cdr.Banking.Common/Entities/Generated/CreditCardAccount.cs b/samples/Cdr.Banking/Cdr.Banking.Common/Entities/Generated/CreditCardAccount.cs index 941b0057a..1c217b584 100644 --- a/samples/Cdr.Banking/Cdr.Banking.Common/Entities/Generated/CreditCardAccount.cs +++ b/samples/Cdr.Banking/Cdr.Banking.Common/Entities/Generated/CreditCardAccount.cs @@ -2,37 +2,30 @@ * This file is automatically generated; any changes will be lost. */ -using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Text.Json.Serialization; -using CoreEx.Entities; +namespace Cdr.Banking.Common.Entities; -namespace Cdr.Banking.Common.Entities +/// +/// Represents the Credit Card Account entity. +/// +public partial class CreditCardAccount { /// - /// Represents the Credit Card Account entity. + /// Gets or sets the Min Payment Amount. /// - public partial class CreditCardAccount - { - /// - /// Gets or sets the Min Payment Amount. - /// - public decimal MinPaymentAmount { get; set; } + public decimal MinPaymentAmount { get; set; } - /// - /// Gets or sets the Payment Due Amount. - /// - public decimal PaymentDueAmount { get; set; } + /// + /// Gets or sets the Payment Due Amount. + /// + public decimal PaymentDueAmount { get; set; } - /// - /// Gets or sets the Payment Currency. - /// - public string? PaymentCurrency { get; set; } + /// + /// Gets or sets the Payment Currency. + /// + public string? PaymentCurrency { get; set; } - /// - /// Gets or sets the Payment Due Date. - /// - public DateTime PaymentDueDate { get; set; } - } -} \ No newline at end of file + /// + /// Gets or sets the Payment Due Date. + /// + public DateTime PaymentDueDate { get; set; } +} diff --git a/samples/Cdr.Banking/Cdr.Banking.Common/Entities/Generated/MaturityInstructions.cs b/samples/Cdr.Banking/Cdr.Banking.Common/Entities/Generated/MaturityInstructions.cs index 5d2176ae2..541eb5a92 100644 --- a/samples/Cdr.Banking/Cdr.Banking.Common/Entities/Generated/MaturityInstructions.cs +++ b/samples/Cdr.Banking/Cdr.Banking.Common/Entities/Generated/MaturityInstructions.cs @@ -2,22 +2,14 @@ * This file is automatically generated; any changes will be lost. */ -using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Text.Json.Serialization; -using CoreEx.Entities; -using CoreEx.RefData; +namespace Cdr.Banking.Common.Entities; -namespace Cdr.Banking.Common.Entities -{ - /// - /// Represents the Maturity Instructions entity. - /// - public partial class MaturityInstructions : ReferenceDataBase { } +/// +/// Represents the Maturity Instructions entity. +/// +public partial class MaturityInstructions : ReferenceDataBase { } - /// - /// Represents the MaturityInstructions collection. - /// - public partial class MaturityInstructionsCollection : List { } -} \ No newline at end of file +/// +/// Represents the MaturityInstructions collection. +/// +public partial class MaturityInstructionsCollection : List { } diff --git a/samples/Cdr.Banking/Cdr.Banking.Common/Entities/Generated/OpenStatus.cs b/samples/Cdr.Banking/Cdr.Banking.Common/Entities/Generated/OpenStatus.cs index d7d4bca2c..6e879c720 100644 --- a/samples/Cdr.Banking/Cdr.Banking.Common/Entities/Generated/OpenStatus.cs +++ b/samples/Cdr.Banking/Cdr.Banking.Common/Entities/Generated/OpenStatus.cs @@ -2,22 +2,14 @@ * This file is automatically generated; any changes will be lost. */ -using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Text.Json.Serialization; -using CoreEx.Entities; -using CoreEx.RefData; +namespace Cdr.Banking.Common.Entities; -namespace Cdr.Banking.Common.Entities -{ - /// - /// Represents the Open Status entity. - /// - public partial class OpenStatus : ReferenceDataBase { } +/// +/// Represents the Open Status entity. +/// +public partial class OpenStatus : ReferenceDataBase { } - /// - /// Represents the OpenStatus collection. - /// - public partial class OpenStatusCollection : List { } -} \ No newline at end of file +/// +/// Represents the OpenStatus collection. +/// +public partial class OpenStatusCollection : List { } diff --git a/samples/Cdr.Banking/Cdr.Banking.Common/Entities/Generated/ProductCategory.cs b/samples/Cdr.Banking/Cdr.Banking.Common/Entities/Generated/ProductCategory.cs index 755dca441..2eda9271b 100644 --- a/samples/Cdr.Banking/Cdr.Banking.Common/Entities/Generated/ProductCategory.cs +++ b/samples/Cdr.Banking/Cdr.Banking.Common/Entities/Generated/ProductCategory.cs @@ -2,22 +2,14 @@ * This file is automatically generated; any changes will be lost. */ -using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Text.Json.Serialization; -using CoreEx.Entities; -using CoreEx.RefData; +namespace Cdr.Banking.Common.Entities; -namespace Cdr.Banking.Common.Entities -{ - /// - /// Represents the Product Category entity. - /// - public partial class ProductCategory : ReferenceDataBase { } +/// +/// Represents the Product Category entity. +/// +public partial class ProductCategory : ReferenceDataBase { } - /// - /// Represents the ProductCategory collection. - /// - public partial class ProductCategoryCollection : List { } -} \ No newline at end of file +/// +/// Represents the ProductCategory collection. +/// +public partial class ProductCategoryCollection : List { } diff --git a/samples/Cdr.Banking/Cdr.Banking.Common/Entities/Generated/TermDepositAccount.cs b/samples/Cdr.Banking/Cdr.Banking.Common/Entities/Generated/TermDepositAccount.cs index a7b68a022..983a441b9 100644 --- a/samples/Cdr.Banking/Cdr.Banking.Common/Entities/Generated/TermDepositAccount.cs +++ b/samples/Cdr.Banking/Cdr.Banking.Common/Entities/Generated/TermDepositAccount.cs @@ -2,42 +2,35 @@ * This file is automatically generated; any changes will be lost. */ -using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Text.Json.Serialization; -using CoreEx.Entities; +namespace Cdr.Banking.Common.Entities; -namespace Cdr.Banking.Common.Entities +/// +/// Represents the Term Deposit Account entity. +/// +public partial class TermDepositAccount { /// - /// Represents the Term Deposit Account entity. + /// Gets or sets the Lodgement Date. /// - public partial class TermDepositAccount - { - /// - /// Gets or sets the Lodgement Date. - /// - public DateTime LodgementDate { get; set; } + public DateTime LodgementDate { get; set; } - /// - /// Gets or sets the Maturity Date. - /// - public DateTime MaturityDate { get; set; } + /// + /// Gets or sets the Maturity Date. + /// + public DateTime MaturityDate { get; set; } - /// - /// Gets or sets the Maturity Amount. - /// - public decimal MaturityAmount { get; set; } + /// + /// Gets or sets the Maturity Amount. + /// + public decimal MaturityAmount { get; set; } - /// - /// Gets or sets the Maturity Currency. - /// - public string? MaturityCurrency { get; set; } + /// + /// Gets or sets the Maturity Currency. + /// + public string? MaturityCurrency { get; set; } - /// - /// Gets or sets the Maturity Instructions code. - /// - public string? MaturityInstructions { get; set; } - } -} \ No newline at end of file + /// + /// Gets or sets the Maturity Instructions code. + /// + public string? MaturityInstructions { get; set; } +} diff --git a/samples/Cdr.Banking/Cdr.Banking.Common/Entities/Generated/Transaction.cs b/samples/Cdr.Banking/Cdr.Banking.Common/Entities/Generated/Transaction.cs index a9d826b2b..04deaf297 100644 --- a/samples/Cdr.Banking/Cdr.Banking.Common/Entities/Generated/Transaction.cs +++ b/samples/Cdr.Banking/Cdr.Banking.Common/Entities/Generated/Transaction.cs @@ -2,127 +2,120 @@ * This file is automatically generated; any changes will be lost. */ -using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Text.Json.Serialization; -using CoreEx.Entities; +namespace Cdr.Banking.Common.Entities; -namespace Cdr.Banking.Common.Entities +/// +/// Represents the Transaction entity. +/// +public partial class Transaction : IIdentifier { /// - /// Represents the Transaction entity. - /// - public partial class Transaction : IIdentifier - { - /// - /// Gets or sets the Account identifier. - /// - [JsonPropertyName("transactionId")] - public string? Id { get; set; } - - /// - /// Gets or sets the Account Id. - /// - public string? AccountId { get; set; } - - /// - /// Indicates whether Is Detail Available. - /// - public bool IsDetailAvailable { get; set; } - - /// - /// Gets or sets the Type code. - /// - public string? Type { get; set; } - - /// - /// Gets or sets the Status code. - /// - public string? Status { get; set; } - - /// - /// Gets or sets the Description. - /// - public string? Description { get; set; } - - /// - /// Gets or sets the Posting Date Time. - /// - public DateTime PostingDateTime { get; set; } - - /// - /// Gets or sets the Execution Date Time. - /// - public DateTime ExecutionDateTime { get; set; } - - /// - /// Gets or sets the Amount. - /// - public decimal Amount { get; set; } - - /// - /// Gets or sets the Currency. - /// - public string? Currency { get; set; } - - /// - /// Gets or sets the Reference. - /// - public string? Reference { get; set; } - - /// - /// Gets or sets the Merchant Name. - /// - public string? MerchantName { get; set; } - - /// - /// Gets or sets the Merchant Category Code. - /// - public string? MerchantCategoryCode { get; set; } - - /// - /// Gets or sets the Biller Code. - /// - public string? BillerCode { get; set; } - - /// - /// Gets or sets the Biller Name. - /// - public string? BillerName { get; set; } - - /// - /// Gets or sets the Apca Number. - /// - public string? ApcaNumber { get; set; } - } - - /// - /// Represents the Transaction collection. - /// - public partial class TransactionCollection : List { } - - /// - /// Represents the Transaction collection result. - /// - public class TransactionCollectionResult : CollectionResult - { - /// - /// Initializes a new instance of the class. - /// - public TransactionCollectionResult() { } - - /// - /// Initializes a new instance of the class with . - /// - /// The . - public TransactionCollectionResult(PagingArgs? paging) : base(paging) { } - - /// - /// Initializes a new instance of the class with to add. - /// - /// The items to add. - /// The . - public TransactionCollectionResult(IEnumerable items, PagingArgs? paging = null) : base(paging) => Items.AddRange(items); - } -} \ No newline at end of file + /// Gets or sets the Account identifier. + /// + [JsonPropertyName("transactionId")] + public string? Id { get; set; } + + /// + /// Gets or sets the Account Id. + /// + public string? AccountId { get; set; } + + /// + /// Indicates whether Is Detail Available. + /// + public bool IsDetailAvailable { get; set; } + + /// + /// Gets or sets the Type code. + /// + public string? Type { get; set; } + + /// + /// Gets or sets the Status code. + /// + public string? Status { get; set; } + + /// + /// Gets or sets the Description. + /// + public string? Description { get; set; } + + /// + /// Gets or sets the Posting Date Time. + /// + public DateTime PostingDateTime { get; set; } + + /// + /// Gets or sets the Execution Date Time. + /// + public DateTime ExecutionDateTime { get; set; } + + /// + /// Gets or sets the Amount. + /// + public decimal Amount { get; set; } + + /// + /// Gets or sets the Currency. + /// + public string? Currency { get; set; } + + /// + /// Gets or sets the Reference. + /// + public string? Reference { get; set; } + + /// + /// Gets or sets the Merchant Name. + /// + public string? MerchantName { get; set; } + + /// + /// Gets or sets the Merchant Category Code. + /// + public string? MerchantCategoryCode { get; set; } + + /// + /// Gets or sets the Biller Code. + /// + public string? BillerCode { get; set; } + + /// + /// Gets or sets the Biller Name. + /// + public string? BillerName { get; set; } + + /// + /// Gets or sets the Apca Number. + /// + public string? ApcaNumber { get; set; } +} + +/// +/// Represents the Transaction collection. +/// +public partial class TransactionCollection : List { } + +/// +/// Represents the Transaction collection result. +/// +public class TransactionCollectionResult : CollectionResult +{ + /// + /// Initializes a new instance of the class. + /// + public TransactionCollectionResult() { } + + /// + /// Initializes a new instance of the class with . + /// + /// The . + public TransactionCollectionResult(PagingArgs? paging) : base(paging) { } + + /// + /// Initializes a new instance of the class with to add. + /// + /// The items to add. + /// The . + public TransactionCollectionResult(IEnumerable items, PagingArgs? paging = null) : base(paging) => Items.AddRange(items); +} diff --git a/samples/Cdr.Banking/Cdr.Banking.Common/Entities/Generated/TransactionArgs.cs b/samples/Cdr.Banking/Cdr.Banking.Common/Entities/Generated/TransactionArgs.cs index 697bb61b7..6b1332eb8 100644 --- a/samples/Cdr.Banking/Cdr.Banking.Common/Entities/Generated/TransactionArgs.cs +++ b/samples/Cdr.Banking/Cdr.Banking.Common/Entities/Generated/TransactionArgs.cs @@ -2,47 +2,40 @@ * This file is automatically generated; any changes will be lost. */ -using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Text.Json.Serialization; -using CoreEx.Entities; +namespace Cdr.Banking.Common.Entities; -namespace Cdr.Banking.Common.Entities +/// +/// Represents the Transaction Arguments entity. +/// +public partial class TransactionArgs { /// - /// Represents the Transaction Arguments entity. + /// Gets or sets the From (oldest time). /// - public partial class TransactionArgs - { - /// - /// Gets or sets the From (oldest time). - /// - [JsonPropertyName("oldest-time")] - public DateTime? FromDate { get; set; } + [JsonPropertyName("oldest-time")] + public DateTime? FromDate { get; set; } - /// - /// Gets or sets the To (newest time). - /// - [JsonPropertyName("newest-time")] - public DateTime? ToDate { get; set; } + /// + /// Gets or sets the To (newest time). + /// + [JsonPropertyName("newest-time")] + public DateTime? ToDate { get; set; } - /// - /// Gets or sets the Min Amount. - /// - [JsonPropertyName("min-amount")] - public decimal? MinAmount { get; set; } + /// + /// Gets or sets the Min Amount. + /// + [JsonPropertyName("min-amount")] + public decimal? MinAmount { get; set; } - /// - /// Gets or sets the Max Amount. - /// - [JsonPropertyName("max-amount")] - public decimal? MaxAmount { get; set; } + /// + /// Gets or sets the Max Amount. + /// + [JsonPropertyName("max-amount")] + public decimal? MaxAmount { get; set; } - /// - /// Gets or sets the Text. - /// - [JsonPropertyName("text")] - public string? Text { get; set; } - } -} \ No newline at end of file + /// + /// Gets or sets the Text. + /// + [JsonPropertyName("text")] + public string? Text { get; set; } +} diff --git a/samples/Cdr.Banking/Cdr.Banking.Common/Entities/Generated/TransactionStatus.cs b/samples/Cdr.Banking/Cdr.Banking.Common/Entities/Generated/TransactionStatus.cs index 4832a473f..b70398058 100644 --- a/samples/Cdr.Banking/Cdr.Banking.Common/Entities/Generated/TransactionStatus.cs +++ b/samples/Cdr.Banking/Cdr.Banking.Common/Entities/Generated/TransactionStatus.cs @@ -2,22 +2,14 @@ * This file is automatically generated; any changes will be lost. */ -using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Text.Json.Serialization; -using CoreEx.Entities; -using CoreEx.RefData; +namespace Cdr.Banking.Common.Entities; -namespace Cdr.Banking.Common.Entities -{ - /// - /// Represents the Transaction Status entity. - /// - public partial class TransactionStatus : ReferenceDataBase { } +/// +/// Represents the Transaction Status entity. +/// +public partial class TransactionStatus : ReferenceDataBase { } - /// - /// Represents the TransactionStatus collection. - /// - public partial class TransactionStatusCollection : List { } -} \ No newline at end of file +/// +/// Represents the TransactionStatus collection. +/// +public partial class TransactionStatusCollection : List { } diff --git a/samples/Cdr.Banking/Cdr.Banking.Common/Entities/Generated/TransactionType.cs b/samples/Cdr.Banking/Cdr.Banking.Common/Entities/Generated/TransactionType.cs index 9b13dbe2a..a1aaad6df 100644 --- a/samples/Cdr.Banking/Cdr.Banking.Common/Entities/Generated/TransactionType.cs +++ b/samples/Cdr.Banking/Cdr.Banking.Common/Entities/Generated/TransactionType.cs @@ -2,22 +2,14 @@ * This file is automatically generated; any changes will be lost. */ -using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Text.Json.Serialization; -using CoreEx.Entities; -using CoreEx.RefData; +namespace Cdr.Banking.Common.Entities; -namespace Cdr.Banking.Common.Entities -{ - /// - /// Represents the Transaction Type entity. - /// - public partial class TransactionType : ReferenceDataBase { } +/// +/// Represents the Transaction Type entity. +/// +public partial class TransactionType : ReferenceDataBase { } - /// - /// Represents the TransactionType collection. - /// - public partial class TransactionTypeCollection : List { } -} \ No newline at end of file +/// +/// Represents the TransactionType collection. +/// +public partial class TransactionTypeCollection : List { } diff --git a/samples/Cdr.Banking/Cdr.Banking.Common/GlobalUsings.cs b/samples/Cdr.Banking/Cdr.Banking.Common/GlobalUsings.cs new file mode 100644 index 000000000..ab4cfd039 --- /dev/null +++ b/samples/Cdr.Banking/Cdr.Banking.Common/GlobalUsings.cs @@ -0,0 +1,13 @@ +global using CoreEx.Entities; +global using CoreEx.Http; +global using CoreEx.Json; +global using CoreEx.RefData; +global using System; +global using System.Collections.Generic; +global using System.Diagnostics.CodeAnalysis; +global using System.Text.Json.Serialization; +global using System.Net.Http; +global using System.Threading; +global using System.Threading.Tasks; +global using Cdr.Banking.Common.Entities; +global using RefDataNamespace = Cdr.Banking.Common.Entities; \ No newline at end of file diff --git a/samples/Demo/Beef.Demo.Business/Data/Model/Generated/Person.cs b/samples/Demo/Beef.Demo.Business/Data/Model/Generated/Person.cs index 510831c0c..b5ab8052e 100644 --- a/samples/Demo/Beef.Demo.Business/Data/Model/Generated/Person.cs +++ b/samples/Demo/Beef.Demo.Business/Data/Model/Generated/Person.cs @@ -5,42 +5,42 @@ #nullable enable #pragma warning disable -namespace Beef.Demo.Business.Data.Model +namespace Beef.Demo.Business.Data.Model; + +/// +/// Represents the Person model. +/// +public partial class Person : IPartitionKey { /// - /// Represents the Person model. + /// Gets or sets the User Name. + /// + public string? UserName { get; set; } + + /// + /// Gets or sets the First Name. + /// + public string? FirstName { get; set; } + + /// + /// Gets or sets the Last Name. /// - public partial class Person : IPartitionKey - { - /// - /// Gets or sets the User Name. - /// - public string? UserName { get; set; } - - /// - /// Gets or sets the First Name. - /// - public string? FirstName { get; set; } - - /// - /// Gets or sets the Last Name. - /// - public string? LastName { get; set; } + public string? LastName { get; set; } - /// - /// Creates the . - /// - /// The partition key. - /// The . - public static string? CreatePartitionKey(string? userName) => CompositeKey.Create(userName).ToString(); - - /// - /// Gets the Partition Key (consists of the following property(s): ). - /// - [JsonIgnore] - public string? PartitionKey => CreatePartitionKey(UserName); - } + /// + /// Creates the . + /// + /// The partition key. + /// The . + public static string? CreatePartitionKey(string? userName) => CompositeKey.Create(userName).ToString(); + + /// + /// Gets the Partition Key (consists of the following property(s): ). + /// + [JsonIgnore] + public string? PartitionKey => CreatePartitionKey(UserName); } + #pragma warning restore #nullable restore \ No newline at end of file diff --git a/samples/Demo/Beef.Demo.Business/Data/Model/Generated/PlaceInfo.cs b/samples/Demo/Beef.Demo.Business/Data/Model/Generated/PlaceInfo.cs index 9aa67ed3b..fde64a290 100644 --- a/samples/Demo/Beef.Demo.Business/Data/Model/Generated/PlaceInfo.cs +++ b/samples/Demo/Beef.Demo.Business/Data/Model/Generated/PlaceInfo.cs @@ -5,31 +5,31 @@ #nullable enable #pragma warning disable -namespace Beef.Demo.Business.Data.Model +namespace Beef.Demo.Business.Data.Model; + +/// +/// Represents the Place Info model. +/// +public partial class PlaceInfo { /// - /// Represents the Place Info model. + /// Gets or sets the Name. /// - public partial class PlaceInfo - { - /// - /// Gets or sets the Name. - /// - [JsonPropertyName("place name")] - public string? Name { get; set; } - - /// - /// Gets or sets the Post Code. - /// - [JsonPropertyName("post code")] - public string? PostCode { get; set; } - } + [JsonPropertyName("place name")] + public string? Name { get; set; } /// - /// Represents the collection. + /// Gets or sets the Post Code. /// - public partial class PlaceInfoCollection : List { } + [JsonPropertyName("post code")] + public string? PostCode { get; set; } } +/// +/// Represents the collection. +/// +public partial class PlaceInfoCollection : List { } + + #pragma warning restore #nullable restore \ No newline at end of file diff --git a/samples/Demo/Beef.Demo.Business/Data/Model/Generated/PostalInfo.cs b/samples/Demo/Beef.Demo.Business/Data/Model/Generated/PostalInfo.cs index 01defe7bb..7ab740e66 100644 --- a/samples/Demo/Beef.Demo.Business/Data/Model/Generated/PostalInfo.cs +++ b/samples/Demo/Beef.Demo.Business/Data/Model/Generated/PostalInfo.cs @@ -5,43 +5,43 @@ #nullable enable #pragma warning disable -namespace Beef.Demo.Business.Data.Model +namespace Beef.Demo.Business.Data.Model; + +/// +/// Represents the Postal Info model. +/// +public partial class PostalInfo : IETag { /// - /// Represents the Postal Info model. + /// Gets or sets the Country code. + /// + [JsonPropertyName("country abbreviation")] + public string? Country { get; set; } + + /// + /// Gets or sets the City. + /// + [JsonPropertyName("place name")] + public string? City { get; set; } + + /// + /// Gets or sets the State. /// - public partial class PostalInfo : IETag - { - /// - /// Gets or sets the Country code. - /// - [JsonPropertyName("country abbreviation")] - public string? Country { get; set; } - - /// - /// Gets or sets the City. - /// - [JsonPropertyName("place name")] - public string? City { get; set; } - - /// - /// Gets or sets the State. - /// - [JsonPropertyName("state abbreviation")] - public string? State { get; set; } - - /// - /// Gets or sets the Places. - /// - public PlaceInfoCollection? Places { get; set; } - - /// - /// Gets or sets the ETag. - /// - [JsonIgnore] - public string? ETag { get; set; } - } + [JsonPropertyName("state abbreviation")] + public string? State { get; set; } + + /// + /// Gets or sets the Places. + /// + public PlaceInfoCollection? Places { get; set; } + + /// + /// Gets or sets the ETag. + /// + [JsonIgnore] + public string? ETag { get; set; } } + #pragma warning restore #nullable restore \ No newline at end of file diff --git a/samples/Demo/Beef.Demo.Business/Data/Model/Generated/PowerSource.cs b/samples/Demo/Beef.Demo.Business/Data/Model/Generated/PowerSource.cs index 205126a6a..b09953254 100644 --- a/samples/Demo/Beef.Demo.Business/Data/Model/Generated/PowerSource.cs +++ b/samples/Demo/Beef.Demo.Business/Data/Model/Generated/PowerSource.cs @@ -5,24 +5,24 @@ #nullable enable #pragma warning disable -namespace Beef.Demo.Business.Data.Model -{ - /// - /// Represents the Power Source model. - /// - public partial class PowerSource : ReferenceDataBase - { - /// - /// Gets or sets the Additional Info. - /// - public string? AdditionalInfo { get; set; } - } +namespace Beef.Demo.Business.Data.Model; +/// +/// Represents the Power Source model. +/// +public partial class PowerSource : ReferenceDataBase +{ /// - /// Represents the collection. + /// Gets or sets the Additional Info. /// - public partial class PowerSourceCollection : List { } + public string? AdditionalInfo { get; set; } } +/// +/// Represents the collection. +/// +public partial class PowerSourceCollection : List { } + + #pragma warning restore #nullable restore \ No newline at end of file diff --git a/samples/Demo/Beef.Demo.Business/Data/Model/Generated/Product.cs b/samples/Demo/Beef.Demo.Business/Data/Model/Generated/Product.cs index 8ebb7422e..65101d132 100644 --- a/samples/Demo/Beef.Demo.Business/Data/Model/Generated/Product.cs +++ b/samples/Demo/Beef.Demo.Business/Data/Model/Generated/Product.cs @@ -5,29 +5,29 @@ #nullable enable #pragma warning disable -namespace Beef.Demo.Business.Data.Model +namespace Beef.Demo.Business.Data.Model; + +/// +/// Represents the Product model. +/// +public partial class Product { /// - /// Represents the Product model. + /// Gets or sets the ID. /// - public partial class Product - { - /// - /// Gets or sets the ID. - /// - public int ID { get; set; } + public int ID { get; set; } - /// - /// Gets or sets the Name. - /// - public string? Name { get; set; } + /// + /// Gets or sets the Name. + /// + public string? Name { get; set; } - /// - /// Gets or sets the Description. - /// - public string? Description { get; set; } - } + /// + /// Gets or sets the Description. + /// + public string? Description { get; set; } } + #pragma warning restore #nullable restore \ No newline at end of file diff --git a/samples/Demo/Beef.Demo.Business/Data/Model/Generated/RefDataPrimaryKey.cs b/samples/Demo/Beef.Demo.Business/Data/Model/Generated/RefDataPrimaryKey.cs index 7472b8058..70faa6007 100644 --- a/samples/Demo/Beef.Demo.Business/Data/Model/Generated/RefDataPrimaryKey.cs +++ b/samples/Demo/Beef.Demo.Business/Data/Model/Generated/RefDataPrimaryKey.cs @@ -5,37 +5,37 @@ #nullable enable #pragma warning disable -namespace Beef.Demo.Business.Data.Model +namespace Beef.Demo.Business.Data.Model; + +/// +/// Represents the Ref Data Primary Key model. +/// +public partial class RefDataPrimaryKey : IPrimaryKey { /// - /// Represents the Ref Data Primary Key model. + /// Gets or sets the Key1 code. /// - public partial class RefDataPrimaryKey : IPrimaryKey - { - /// - /// Gets or sets the Key1 code. - /// - public string? Key1 { get; set; } + public string? Key1 { get; set; } - /// - /// Gets or sets the Other. - /// - public string? Other { get; set; } + /// + /// Gets or sets the Other. + /// + public string? Other { get; set; } - /// - /// Creates the primary . - /// - /// The primary . - /// The . + /// + /// Creates the primary . + /// + /// The primary . + /// The . public static CompositeKey CreatePrimaryKey(string? key1) => CompositeKey.Create(key1); - /// - /// Gets the primary (consists of the following property(s): ). - /// - [JsonIgnore] - public CompositeKey PrimaryKey => CreatePrimaryKey(Key1); - } + /// + /// Gets the primary (consists of the following property(s): ). + /// + [JsonIgnore] + public CompositeKey PrimaryKey => CreatePrimaryKey(Key1); } + #pragma warning restore #nullable restore \ No newline at end of file diff --git a/samples/Demo/Beef.Demo.Business/Data/Model/Generated/Robot.cs b/samples/Demo/Beef.Demo.Business/Data/Model/Generated/Robot.cs index b14506d33..09e007882 100644 --- a/samples/Demo/Beef.Demo.Business/Data/Model/Generated/Robot.cs +++ b/samples/Demo/Beef.Demo.Business/Data/Model/Generated/Robot.cs @@ -5,56 +5,56 @@ #nullable enable #pragma warning disable -namespace Beef.Demo.Business.Data.Model +namespace Beef.Demo.Business.Data.Model; + +/// +/// Represents the Robot model. +/// +public partial class Robot : IIdentifier, IETag, IChangeLog { /// - /// Represents the Robot model. + /// Gets or sets the identifier. + /// + public string? Id { get; set; } + + /// + /// Gets or sets the Model No. + /// + public string? ModelNo { get; set; } + + /// + /// Gets or sets the Serial No. + /// + public string? SerialNo { get; set; } + + /// + /// Gets or sets the Eye Color. /// - public partial class Robot : IIdentifier, IETag, IChangeLog - { - /// - /// Gets or sets the identifier. - /// - public string? Id { get; set; } - - /// - /// Gets or sets the Model No. - /// - public string? ModelNo { get; set; } - - /// - /// Gets or sets the Serial No. - /// - public string? SerialNo { get; set; } - - /// - /// Gets or sets the Eye Color. - /// - public string? EyeColor { get; set; } - - /// - /// Gets or sets the Power Source. - /// - public string? PowerSource { get; set; } - - /// - /// Gets or sets the ETag. - /// - [Newtonsoft.Json.JsonProperty("_etag")] - [JsonPropertyName("_etag")] - public string? ETag { get; set; } - - /// - /// Gets or sets the Change Log. - /// - public ChangeLog? ChangeLog { get; set; } - } + public string? EyeColor { get; set; } /// - /// Represents the collection. + /// Gets or sets the Power Source. /// - public partial class RobotCollection : List { } + public string? PowerSource { get; set; } + + /// + /// Gets or sets the ETag. + /// + [Newtonsoft.Json.JsonProperty("_etag")] + [JsonPropertyName("_etag")] + public string? ETag { get; set; } + + /// + /// Gets or sets the Change Log. + /// + public ChangeLog? ChangeLog { get; set; } } +/// +/// Represents the collection. +/// +public partial class RobotCollection : List { } + + #pragma warning restore #nullable restore \ No newline at end of file diff --git a/samples/Demo/Beef.Demo.Business/Entities/Generated/PersonOther.cs b/samples/Demo/Beef.Demo.Business/Entities/Generated/PersonOther.cs index fe2fd06d4..77539d11b 100644 --- a/samples/Demo/Beef.Demo.Business/Entities/Generated/PersonOther.cs +++ b/samples/Demo/Beef.Demo.Business/Entities/Generated/PersonOther.cs @@ -5,51 +5,45 @@ #nullable enable #pragma warning disable -using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Text.Json.Serialization; -using CoreEx.Entities; +namespace Beef.Demo.Business.Entities; -namespace Beef.Demo.Business.Entities +/// +/// Represents the other without capabilities entity. +/// +public partial class PersonOther : IIdentifier, IETag, IChangeLog { /// - /// Represents the other without capabilities entity. + /// Gets or sets the identifier. /// - public partial class PersonOther : IIdentifier, IETag, IChangeLog - { - /// - /// Gets or sets the identifier. - /// - public Guid Id { get; set; } - - /// - /// Gets or sets the First Name. - /// - public string? FirstName { get; set; } - - /// - /// Gets or sets the Last Name. - /// - public string? LastName { get; set; } - - /// - /// Gets or sets the ETag. - /// - [JsonPropertyName("etag")] - public string? ETag { get; set; } - - /// - /// Gets or sets the Change Log. - /// - public ChangeLog? ChangeLog { get; set; } - } + public Guid Id { get; set; } /// - /// Represents the collection. + /// Gets or sets the First Name. /// - public partial class PersonOtherCollection : List { } + public string? FirstName { get; set; } + + /// + /// Gets or sets the Last Name. + /// + public string? LastName { get; set; } + + /// + /// Gets or sets the ETag. + /// + [JsonPropertyName("etag")] + public string? ETag { get; set; } + + /// + /// Gets or sets the Change Log. + /// + public ChangeLog? ChangeLog { get; set; } } +/// +/// Represents the collection. +/// +public partial class PersonOtherCollection : List { } + + #pragma warning restore #nullable restore \ No newline at end of file diff --git a/samples/Demo/Beef.Demo.Common/Agents/Generated/ConfigAgent.cs b/samples/Demo/Beef.Demo.Common/Agents/Generated/ConfigAgent.cs index 52a64fc2b..d8b4ae2cc 100644 --- a/samples/Demo/Beef.Demo.Common/Agents/Generated/ConfigAgent.cs +++ b/samples/Demo/Beef.Demo.Common/Agents/Generated/ConfigAgent.cs @@ -5,36 +5,24 @@ #nullable enable #pragma warning disable -using System; -using System.Collections.Generic; -using System.Net.Http; -using System.Threading; -using System.Threading.Tasks; -using CoreEx.Entities; -using CoreEx.Http; -using CoreEx.Json; -using Beef.Demo.Common.Entities; -using RefDataNamespace = Beef.Demo.Common.Entities; +namespace Beef.Demo.Common.Agents; -namespace Beef.Demo.Common.Agents +/// +/// Provides the Config HTTP agent. +/// +public partial class ConfigAgent : TypedHttpClientBase, IConfigAgent { /// - /// Provides the Config HTTP agent. + /// Initializes a new instance of the class. /// - public partial class ConfigAgent : TypedHttpClientBase, 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) { } + /// 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); - } + /// + public Task> GetEnvVarsAsync(HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) + => PostAsync("api/v1/envvars", requestOptions: requestOptions, cancellationToken: cancellationToken); } #pragma warning restore diff --git a/samples/Demo/Beef.Demo.Common/Agents/Generated/ContactAgent.cs b/samples/Demo/Beef.Demo.Common/Agents/Generated/ContactAgent.cs index 5ce2ff699..092d2b951 100644 --- a/samples/Demo/Beef.Demo.Common/Agents/Generated/ContactAgent.cs +++ b/samples/Demo/Beef.Demo.Common/Agents/Generated/ContactAgent.cs @@ -5,64 +5,52 @@ #nullable enable #pragma warning disable -using System; -using System.Collections.Generic; -using System.Net.Http; -using System.Threading; -using System.Threading.Tasks; -using CoreEx.Entities; -using CoreEx.Http; -using CoreEx.Json; -using Beef.Demo.Common.Entities; -using RefDataNamespace = Beef.Demo.Common.Entities; +namespace Beef.Demo.Common.Agents; -namespace Beef.Demo.Common.Agents +/// +/// Provides the HTTP agent. +/// +public partial class ContactAgent : TypedHttpClientBase, IContactAgent { /// - /// Provides the HTTP agent. + /// Initializes a new instance of the class. /// - public partial class ContactAgent : TypedHttpClientBase, 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); - - /// - public Task> GetAllAsync(HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) - => GetAsync("api/v1/contacts", requestOptions: requestOptions, cancellationToken: cancellationToken); - - /// - 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); - - /// - public Task> CreateAsync(Contact value, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) - => PostAsync("api/v1/contacts", value, requestOptions: 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); - - /// - 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); - - /// - 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); - - /// - 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); - } + /// 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); + + /// + public Task> GetAllAsync(HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) + => GetAsync("api/v1/contacts", requestOptions: requestOptions, cancellationToken: cancellationToken); + + /// + 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); + + /// + public Task> CreateAsync(Contact value, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) + => PostAsync("api/v1/contacts", value, requestOptions: 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); + + /// + 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); + + /// + 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); + + /// + 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); } #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 771b213d3..7765782c2 100644 --- a/samples/Demo/Beef.Demo.Common/Agents/Generated/GenderAgent.cs +++ b/samples/Demo/Beef.Demo.Common/Agents/Generated/GenderAgent.cs @@ -5,44 +5,32 @@ #nullable enable #pragma warning disable -using System; -using System.Collections.Generic; -using System.Net.Http; -using System.Threading; -using System.Threading.Tasks; -using CoreEx.Entities; -using CoreEx.Http; -using CoreEx.Json; -using Beef.Demo.Common.Entities; -using RefDataNamespace = Beef.Demo.Common.Entities; +namespace Beef.Demo.Common.Agents; -namespace Beef.Demo.Common.Agents +/// +/// Provides the HTTP agent. +/// +public partial class GenderAgent : TypedHttpClientBase, IGenderAgent { /// - /// Provides the HTTP agent. + /// Initializes a new instance of the class. /// - public partial class GenderAgent : TypedHttpClientBase, 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) { } + /// 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); + /// + 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); - /// - public Task> CreateAsync(Gender value, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) - => PostAsync("api/v1/demo/ref/genders", value, requestOptions: requestOptions, cancellationToken: cancellationToken); + /// + public Task> CreateAsync(Gender value, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) + => PostAsync("api/v1/demo/ref/genders", value, requestOptions: 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); - } + /// + 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); } #pragma warning restore diff --git a/samples/Demo/Beef.Demo.Common/Agents/Generated/IConfigAgent.cs b/samples/Demo/Beef.Demo.Common/Agents/Generated/IConfigAgent.cs index d39b2b020..d8fce8579 100644 --- a/samples/Demo/Beef.Demo.Common/Agents/Generated/IConfigAgent.cs +++ b/samples/Demo/Beef.Demo.Common/Agents/Generated/IConfigAgent.cs @@ -5,34 +5,20 @@ #nullable enable #pragma warning disable -using System; -using System.Collections.Generic; -using System.Net.Http; -using System.Threading; -using System.Threading.Tasks; -using CoreEx.Configuration; -using CoreEx.Entities; -using CoreEx.Http; -using CoreEx.Json; -using Microsoft.Extensions.Logging; -using Beef.Demo.Common.Entities; -using RefDataNamespace = Beef.Demo.Common.Entities; +namespace Beef.Demo.Common.Agents; -namespace Beef.Demo.Common.Agents +/// +/// Defines the Config HTTP agent. +/// +public partial interface IConfigAgent { /// - /// Defines the Config HTTP agent. + /// Get Env Vars. /// - public partial interface IConfigAgent - { - /// - /// Get Env Vars. - /// - /// The optional . - /// The . - /// A . - Task> GetEnvVarsAsync(HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); - } + /// The optional . + /// The . + /// A . + Task> GetEnvVarsAsync(HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); } #pragma warning restore diff --git a/samples/Demo/Beef.Demo.Common/Agents/Generated/IContactAgent.cs b/samples/Demo/Beef.Demo.Common/Agents/Generated/IContactAgent.cs index 43554e83b..cf661b7cd 100644 --- a/samples/Demo/Beef.Demo.Common/Agents/Generated/IContactAgent.cs +++ b/samples/Demo/Beef.Demo.Common/Agents/Generated/IContactAgent.cs @@ -5,101 +5,87 @@ #nullable enable #pragma warning disable -using System; -using System.Collections.Generic; -using System.Net.Http; -using System.Threading; -using System.Threading.Tasks; -using CoreEx.Configuration; -using CoreEx.Entities; -using CoreEx.Http; -using CoreEx.Json; -using Microsoft.Extensions.Logging; -using Beef.Demo.Common.Entities; -using RefDataNamespace = Beef.Demo.Common.Entities; +namespace Beef.Demo.Common.Agents; -namespace Beef.Demo.Common.Agents +/// +/// Defines the HTTP agent. +/// +public partial interface IContactAgent { /// - /// Defines the HTTP agent. + /// Gets the that contains the items that match the selection criteria. /// - public partial interface IContactAgent - { - /// - /// Gets the that contains the items that match the selection criteria. - /// - /// The . - /// The . - /// The optional . - /// The . - /// A . - Task> GetByQueryAsync(QueryArgs? query = null, PagingArgs? paging = null, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); + /// The . + /// The . + /// The optional . + /// The . + /// A . + Task> GetByQueryAsync(QueryArgs? query = null, PagingArgs? paging = null, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); - /// - /// Gets the that contains the items that match the selection criteria. - /// - /// The optional . - /// The . - /// A . - Task> GetAllAsync(HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); + /// + /// Gets the that contains the items that match the selection criteria. + /// + /// The optional . + /// The . + /// A . + Task> GetAllAsync(HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); - /// - /// Gets the specified . - /// - /// The identifier. - /// The optional . - /// The . - /// A . - Task> GetAsync(Guid id, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); + /// + /// Gets the specified . + /// + /// The identifier. + /// The optional . + /// The . + /// A . + Task> GetAsync(Guid id, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); - /// - /// Creates a new . - /// - /// The . - /// The optional . - /// The . - /// A . - Task> CreateAsync(Contact value, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); + /// + /// Creates a new . + /// + /// The . + /// The optional . + /// The . + /// A . + Task> CreateAsync(Contact value, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); - /// - /// Updates an existing . - /// - /// The . - /// The identifier. - /// The optional . - /// The . - /// A . - Task> UpdateAsync(Contact value, Guid id, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); + /// + /// Updates an existing . + /// + /// The . + /// The identifier. + /// The optional . + /// The . + /// A . + Task> UpdateAsync(Contact value, Guid id, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); - /// - /// Patches an existing . - /// - /// The . - /// The that contains the patch content for the . - /// The identifier. - /// The optional . - /// The . - /// A . - Task> PatchAsync(HttpPatchOption patchOption, string value, Guid id, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); + /// + /// Patches an existing . + /// + /// The . + /// The that contains the patch content for the . + /// The identifier. + /// The optional . + /// The . + /// A . + Task> PatchAsync(HttpPatchOption patchOption, string value, Guid id, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); - /// - /// Deletes the specified . - /// - /// The identifier. - /// The optional . - /// The . - /// A . - Task DeleteAsync(Guid id, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); + /// + /// Deletes the specified . + /// + /// The identifier. + /// The optional . + /// The . + /// A . + Task DeleteAsync(Guid id, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); - /// - /// Raise Event. - /// - /// Indicates whether throw a DivideByZero exception. - /// The optional . - /// The . - /// A . - Task RaiseEventAsync(bool throwError, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); - } + /// + /// Raise Event. + /// + /// Indicates whether throw a DivideByZero exception. + /// The optional . + /// The . + /// A . + Task RaiseEventAsync(bool throwError, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); } #pragma warning restore diff --git a/samples/Demo/Beef.Demo.Common/Agents/Generated/IGenderAgent.cs b/samples/Demo/Beef.Demo.Common/Agents/Generated/IGenderAgent.cs index c045030d7..474c96644 100644 --- a/samples/Demo/Beef.Demo.Common/Agents/Generated/IGenderAgent.cs +++ b/samples/Demo/Beef.Demo.Common/Agents/Generated/IGenderAgent.cs @@ -5,54 +5,40 @@ #nullable enable #pragma warning disable -using System; -using System.Collections.Generic; -using System.Net.Http; -using System.Threading; -using System.Threading.Tasks; -using CoreEx.Configuration; -using CoreEx.Entities; -using CoreEx.Http; -using CoreEx.Json; -using Microsoft.Extensions.Logging; -using Beef.Demo.Common.Entities; -using RefDataNamespace = Beef.Demo.Common.Entities; +namespace Beef.Demo.Common.Agents; -namespace Beef.Demo.Common.Agents +/// +/// Defines the HTTP agent. +/// +public partial interface IGenderAgent { /// - /// Defines the HTTP agent. + /// Gets the specified . /// - public partial interface IGenderAgent - { - /// - /// Gets the specified . - /// - /// The identifier. - /// The optional . - /// The . - /// A . - Task> GetAsync(Guid id, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); + /// The identifier. + /// The optional . + /// The . + /// A . + Task> GetAsync(Guid id, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); - /// - /// Creates a new . - /// - /// The . - /// The optional . - /// The . - /// A . - Task> CreateAsync(Gender value, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); + /// + /// Creates a new . + /// + /// The . + /// The optional . + /// The . + /// A . + Task> CreateAsync(Gender value, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); - /// - /// Updates an existing . - /// - /// The . - /// The identifier. - /// The optional . - /// The . - /// A . - Task> UpdateAsync(Gender value, Guid id, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); - } + /// + /// Updates an existing . + /// + /// The . + /// The identifier. + /// The optional . + /// The . + /// A . + Task> UpdateAsync(Gender value, Guid id, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); } #pragma warning restore diff --git a/samples/Demo/Beef.Demo.Common/Agents/Generated/IPersonAgent.cs b/samples/Demo/Beef.Demo.Common/Agents/Generated/IPersonAgent.cs index 4949159ff..a782c9b84 100644 --- a/samples/Demo/Beef.Demo.Common/Agents/Generated/IPersonAgent.cs +++ b/samples/Demo/Beef.Demo.Common/Agents/Generated/IPersonAgent.cs @@ -5,360 +5,346 @@ #nullable enable #pragma warning disable -using System; -using System.Collections.Generic; -using System.Net.Http; -using System.Threading; -using System.Threading.Tasks; -using CoreEx.Configuration; -using CoreEx.Entities; -using CoreEx.Http; -using CoreEx.Json; -using Microsoft.Extensions.Logging; -using Beef.Demo.Common.Entities; -using RefDataNamespace = Beef.Demo.Common.Entities; - -namespace Beef.Demo.Common.Agents +namespace Beef.Demo.Common.Agents; + +/// +/// Defines the HTTP agent. +/// +public partial interface IPersonAgent { /// - /// Defines the HTTP agent. - /// - public partial interface IPersonAgent - { - /// - /// Creates a new . - /// - /// The . - /// The optional . - /// The . - /// A . - Task> CreateAsync(Person value, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); - - /// - /// Deletes the specified . - /// - /// The identifier. - /// The optional . - /// The . - /// A . - Task DeleteAsync(Guid id, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); - - /// - /// Gets the specified . - /// - /// The identifier. - /// The optional . - /// The . - /// A . - Task> GetAsync(Guid id, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); - - /// - /// Gets the specified . - /// - /// The identifier. - /// The optional . - /// The . - /// A . - Task> GetExAsync(Guid id, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); - - /// - /// Updates an existing . - /// - /// The . - /// The identifier. - /// The optional . - /// The . - /// A . - Task> UpdateAsync(Person value, Guid id, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); - - /// - /// Updates an existing . - /// - /// The . - /// The identifier. - /// The optional . - /// The . - /// A . - Task> UpdateWithRollbackAsync(Person value, Guid id, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); - - /// - /// Patches an existing . - /// - /// The . - /// The that contains the patch content for the . - /// The identifier. - /// The optional . - /// The . - /// A . - Task> PatchAsync(HttpPatchOption patchOption, string value, Guid id, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); - - /// - /// Gets the that contains the items that match the selection criteria. - /// - /// The . - /// The optional . - /// The . - /// A . - Task> GetAllAsync(PagingArgs? paging = null, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); - - /// - /// Gets the that contains the items that match the selection criteria. - /// - /// The optional . - /// The . - /// A . - Task> GetAll2Async(HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); - - /// - /// Gets the that contains the items that match the selection criteria. - /// - /// The Args (see ). - /// The . - /// The optional . - /// The . - /// A . - Task> GetByArgsAsync(PersonArgs? args, PagingArgs? paging = null, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); - - /// - /// Gets the that contains the items that match the selection criteria. - /// - /// The Args (see ). - /// The . - /// The optional . - /// The . - /// A . - Task> GetDetailByArgsAsync(PersonArgs? args, PagingArgs? paging = null, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); - - /// - /// Merge first into second. - /// - /// The from identifier. - /// The to identifier. - /// The optional . - /// The . - /// A . - Task> MergeAsync(Guid fromId, Guid toId, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); - - /// - /// Mark . - /// - /// The optional . - /// The . - /// A . - Task MarkAsync(HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); - - /// - /// Get at specified . - /// - /// The Args (see ). - /// The optional . - /// The . - /// A . - Task> MapAsync(MapArgs? args, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); - - /// - /// Get no arguments. - /// - /// The optional . - /// The . - /// A . - Task> GetNoArgsAsync(HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); - - /// - /// Gets the specified . - /// - /// The identifier. - /// The optional . - /// The . - /// A . - Task> GetDetailAsync(Guid id, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); - - /// - /// Updates an existing . - /// - /// The . - /// The identifier. - /// The optional . - /// The . - /// A . - Task> UpdateDetailAsync(PersonDetail value, Guid id, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); - - /// - /// Patches an existing . - /// - /// The . - /// The that contains the patch content for the . - /// The identifier. - /// The optional . - /// The . - /// A . - Task> PatchDetailAsync(HttpPatchOption patchOption, string value, Guid id, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); - - /// - /// Actually validating the FromBody parameter generation. - /// - /// The Person (see ). - /// The optional . - /// The . - /// A . - Task AddAsync(Person person, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); - - /// - /// Actually validating the AcceptBody parameter generation. - /// - /// The Person (see ). - /// The optional . - /// The . - /// A . - Task Add2Async(Person person, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); - - /// - /// Actually validating the Custom with Value parameter generation. - /// - /// The . - /// The optional . - /// The . - /// A . - Task Add3Async(Person value, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); - - /// - /// Validate CustomManagerOnly. - /// - /// The optional . - /// The . - /// A . - Task CustomManagerOnlyAsync(HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); - - /// - /// Get Null. - /// - /// The Name. - /// The Names. - /// The optional . - /// The . - /// A . - Task> GetNullAsync(string? name, List? names, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); - - /// - /// Validate when an Event is published but not sent. - /// - /// The . - /// The optional . - /// The . - /// A . - Task> EventPublishNoSendAsync(Person value, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); - - /// - /// Gets the that contains the items that match the selection criteria. - /// - /// The Args (see ). - /// The . - /// The optional . - /// The . - /// A . - Task> GetByArgsWithEfAsync(PersonArgs? args, PagingArgs? paging = null, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); - - /// - /// Throw Error. - /// - /// The optional . - /// The . - /// A . - Task ThrowErrorAsync(HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); - - /// - /// Invoke Api Via Agent. - /// - /// The identifier. - /// The optional . - /// The . - /// A . - Task> InvokeApiViaAgentAsync(Guid id, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); - - /// - /// Param Coll. - /// - /// The Addresses. - /// The optional . - /// The . - /// A . - Task ParamCollAsync(AddressCollection? addresses, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); - - /// - /// Gets the specified . - /// - /// The identifier. - /// The optional . - /// The . - /// A . - Task> GetWithEfAsync(Guid id, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); - - /// - /// Creates a new . - /// - /// The . - /// The optional . - /// The . - /// A . - Task> CreateWithEfAsync(Person value, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); - - /// - /// Updates an existing . - /// - /// The . - /// The identifier. - /// The optional . - /// The . - /// A . - Task> UpdateWithEfAsync(Person value, Guid id, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); - - /// - /// Deletes the specified . - /// - /// The identifier. - /// The optional . - /// The . - /// A . - Task DeleteWithEfAsync(Guid id, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); - - /// - /// Patches an existing . - /// - /// The . - /// The that contains the patch content for the . - /// The identifier. - /// The optional . - /// The . - /// A . - Task> PatchWithEfAsync(HttpPatchOption patchOption, string value, Guid id, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); - - /// - /// Get Documentation. - /// - /// The identifier. - /// The optional . - /// The . - /// A . - Task GetDocumentationAsync(Guid id, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); - - /// - /// Simulate Work. - /// - /// The identifier. - /// The optional . - /// The . - /// A . - Task> SimulateWorkAsync(Guid id, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); - - /// - /// Extend Response. - /// - /// The Name. - /// The optional . - /// The . - /// A . - Task> ExtendResponseAsync(string? name, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); - } + /// Creates a new . + /// + /// The . + /// The optional . + /// The . + /// A . + Task> CreateAsync(Person value, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); + + /// + /// Deletes the specified . + /// + /// The identifier. + /// The optional . + /// The . + /// A . + Task DeleteAsync(Guid id, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); + + /// + /// Gets the specified . + /// + /// The identifier. + /// The optional . + /// The . + /// A . + Task> GetAsync(Guid id, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); + + /// + /// Gets the specified . + /// + /// The identifier. + /// The optional . + /// The . + /// A . + Task> GetExAsync(Guid id, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); + + /// + /// Updates an existing . + /// + /// The . + /// The identifier. + /// The optional . + /// The . + /// A . + Task> UpdateAsync(Person value, Guid id, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); + + /// + /// Updates an existing . + /// + /// The . + /// The identifier. + /// The optional . + /// The . + /// A . + Task> UpdateWithRollbackAsync(Person value, Guid id, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); + + /// + /// Patches an existing . + /// + /// The . + /// The that contains the patch content for the . + /// The identifier. + /// The optional . + /// The . + /// A . + Task> PatchAsync(HttpPatchOption patchOption, string value, Guid id, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); + + /// + /// Gets the that contains the items that match the selection criteria. + /// + /// The . + /// The optional . + /// The . + /// A . + Task> GetAllAsync(PagingArgs? paging = null, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); + + /// + /// Gets the that contains the items that match the selection criteria. + /// + /// The optional . + /// The . + /// A . + Task> GetAll2Async(HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); + + /// + /// Gets the that contains the items that match the selection criteria. + /// + /// The Args (see ). + /// The . + /// The optional . + /// The . + /// A . + Task> GetByArgsAsync(PersonArgs? args, PagingArgs? paging = null, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); + + /// + /// Gets the that contains the items that match the selection criteria. + /// + /// The Args (see ). + /// The . + /// The optional . + /// The . + /// A . + Task> GetDetailByArgsAsync(PersonArgs? args, PagingArgs? paging = null, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); + + /// + /// Merge first into second. + /// + /// The from identifier. + /// The to identifier. + /// The optional . + /// The . + /// A . + Task> MergeAsync(Guid fromId, Guid toId, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); + + /// + /// Mark . + /// + /// The optional . + /// The . + /// A . + Task MarkAsync(HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); + + /// + /// Get at specified . + /// + /// The Args (see ). + /// The optional . + /// The . + /// A . + Task> MapAsync(MapArgs? args, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); + + /// + /// Get no arguments. + /// + /// The optional . + /// The . + /// A . + Task> GetNoArgsAsync(HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); + + /// + /// Gets the specified . + /// + /// The identifier. + /// The optional . + /// The . + /// A . + Task> GetDetailAsync(Guid id, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); + + /// + /// Updates an existing . + /// + /// The . + /// The identifier. + /// The optional . + /// The . + /// A . + Task> UpdateDetailAsync(PersonDetail value, Guid id, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); + + /// + /// Patches an existing . + /// + /// The . + /// The that contains the patch content for the . + /// The identifier. + /// The optional . + /// The . + /// A . + Task> PatchDetailAsync(HttpPatchOption patchOption, string value, Guid id, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); + + /// + /// Actually validating the FromBody parameter generation. + /// + /// The Person (see ). + /// The optional . + /// The . + /// A . + Task AddAsync(Person person, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); + + /// + /// Actually validating the AcceptBody parameter generation. + /// + /// The Person (see ). + /// The optional . + /// The . + /// A . + Task Add2Async(Person person, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); + + /// + /// Actually validating the Custom with Value parameter generation. + /// + /// The . + /// The optional . + /// The . + /// A . + Task Add3Async(Person value, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); + + /// + /// Validate CustomManagerOnly. + /// + /// The optional . + /// The . + /// A . + Task CustomManagerOnlyAsync(HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); + + /// + /// Get Null. + /// + /// The Name. + /// The Names. + /// The optional . + /// The . + /// A . + Task> GetNullAsync(string? name, List? names, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); + + /// + /// Validate when an Event is published but not sent. + /// + /// The . + /// The optional . + /// The . + /// A . + Task> EventPublishNoSendAsync(Person value, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); + + /// + /// Gets the that contains the items that match the selection criteria. + /// + /// The Args (see ). + /// The . + /// The optional . + /// The . + /// A . + Task> GetByArgsWithEfAsync(PersonArgs? args, PagingArgs? paging = null, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); + + /// + /// Throw Error. + /// + /// The optional . + /// The . + /// A . + Task ThrowErrorAsync(HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); + + /// + /// Invoke Api Via Agent. + /// + /// The identifier. + /// The optional . + /// The . + /// A . + Task> InvokeApiViaAgentAsync(Guid id, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); + + /// + /// Param Coll. + /// + /// The Addresses. + /// The optional . + /// The . + /// A . + Task ParamCollAsync(AddressCollection? addresses, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); + + /// + /// Gets the specified . + /// + /// The identifier. + /// The optional . + /// The . + /// A . + Task> GetWithEfAsync(Guid id, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); + + /// + /// Creates a new . + /// + /// The . + /// The optional . + /// The . + /// A . + Task> CreateWithEfAsync(Person value, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); + + /// + /// Updates an existing . + /// + /// The . + /// The identifier. + /// The optional . + /// The . + /// A . + Task> UpdateWithEfAsync(Person value, Guid id, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); + + /// + /// Deletes the specified . + /// + /// The identifier. + /// The optional . + /// The . + /// A . + Task DeleteWithEfAsync(Guid id, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); + + /// + /// Patches an existing . + /// + /// The . + /// The that contains the patch content for the . + /// The identifier. + /// The optional . + /// The . + /// A . + Task> PatchWithEfAsync(HttpPatchOption patchOption, string value, Guid id, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); + + /// + /// Get Documentation. + /// + /// The identifier. + /// The optional . + /// The . + /// A . + Task GetDocumentationAsync(Guid id, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); + + /// + /// Simulate Work. + /// + /// The identifier. + /// The optional . + /// The . + /// A . + Task> SimulateWorkAsync(Guid id, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); + + /// + /// Extend Response. + /// + /// The Name. + /// The optional . + /// The . + /// A . + Task> ExtendResponseAsync(string? name, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); } #pragma warning restore diff --git a/samples/Demo/Beef.Demo.Common/Agents/Generated/IPostalInfoAgent.cs b/samples/Demo/Beef.Demo.Common/Agents/Generated/IPostalInfoAgent.cs index 6f72d2027..1e07a3adc 100644 --- a/samples/Demo/Beef.Demo.Common/Agents/Generated/IPostalInfoAgent.cs +++ b/samples/Demo/Beef.Demo.Common/Agents/Generated/IPostalInfoAgent.cs @@ -5,85 +5,71 @@ #nullable enable #pragma warning disable -using System; -using System.Collections.Generic; -using System.Net.Http; -using System.Threading; -using System.Threading.Tasks; -using CoreEx.Configuration; -using CoreEx.Entities; -using CoreEx.Http; -using CoreEx.Json; -using Microsoft.Extensions.Logging; -using Beef.Demo.Common.Entities; -using RefDataNamespace = Beef.Demo.Common.Entities; +namespace Beef.Demo.Common.Agents; -namespace Beef.Demo.Common.Agents +/// +/// Defines the HTTP agent. +/// +public partial interface IPostalInfoAgent { /// - /// Defines the HTTP agent. + /// Gets the specified . /// - public partial interface IPostalInfoAgent - { - /// - /// Gets the specified . - /// - /// The Country. - /// The State. - /// The City. - /// The optional . - /// The . - /// A . - Task> GetPostCodesAsync(string? country, string? state, string? city, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); + /// The Country. + /// The State. + /// The City. + /// The optional . + /// The . + /// A . + Task> GetPostCodesAsync(string? country, string? state, string? city, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); - /// - /// Creates a new . - /// - /// The . - /// The Country. - /// The State. - /// The City. - /// The optional . - /// The . - /// A . - Task> CreatePostCodesAsync(PostalInfo value, string? country, string? state, string? city, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); + /// + /// Creates a new . + /// + /// The . + /// The Country. + /// The State. + /// The City. + /// The optional . + /// The . + /// A . + Task> CreatePostCodesAsync(PostalInfo value, string? country, string? state, string? city, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); - /// - /// Updates an existing . - /// - /// The . - /// The Country. - /// The State. - /// The City. - /// The optional . - /// The . - /// A . - Task> UpdatePostCodesAsync(PostalInfo value, string? country, string? state, string? city, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); + /// + /// Updates an existing . + /// + /// The . + /// The Country. + /// The State. + /// The City. + /// The optional . + /// The . + /// A . + Task> UpdatePostCodesAsync(PostalInfo value, string? country, string? state, string? city, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); - /// - /// Patches an existing . - /// - /// The . - /// The that contains the patch content for the . - /// The Country. - /// The State. - /// The City. - /// The optional . - /// The . - /// A . - Task> PatchPostCodesAsync(HttpPatchOption patchOption, string value, string? country, string? state, string? city, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); + /// + /// Patches an existing . + /// + /// The . + /// The that contains the patch content for the . + /// The Country. + /// The State. + /// The City. + /// The optional . + /// The . + /// A . + Task> PatchPostCodesAsync(HttpPatchOption patchOption, string value, string? country, string? state, string? city, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); - /// - /// Deletes the specified . - /// - /// The Country. - /// The State. - /// The City. - /// The optional . - /// The . - /// A . - Task DeletePostCodesAsync(string? country, string? state, string? city, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); - } + /// + /// Deletes the specified . + /// + /// The Country. + /// The State. + /// The City. + /// The optional . + /// The . + /// A . + Task DeletePostCodesAsync(string? country, string? state, string? city, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); } #pragma warning restore diff --git a/samples/Demo/Beef.Demo.Common/Agents/Generated/IReferenceDataAgent.cs b/samples/Demo/Beef.Demo.Common/Agents/Generated/IReferenceDataAgent.cs index 7eedd9f1c..4ca2cd7ab 100644 --- a/samples/Demo/Beef.Demo.Common/Agents/Generated/IReferenceDataAgent.cs +++ b/samples/Demo/Beef.Demo.Common/Agents/Generated/IReferenceDataAgent.cs @@ -5,109 +5,94 @@ #nullable enable #pragma warning disable -using System; -using System.Collections.Generic; -using System.Net.Http; -using System.Threading; -using System.Threading.Tasks; -using CoreEx.Configuration; -using CoreEx.Entities; -using CoreEx.Http; -using CoreEx.Json; -using CoreEx.RefData; -using Microsoft.Extensions.Logging; -using Beef.Demo.Common.Entities; -using RefDataNamespace = Beef.Demo.Common.Entities; +namespace Beef.Demo.Common.Agents; -namespace Beef.Demo.Common.Agents +/// +/// Defines the ReferenceData HTTP agent. +/// +public partial interface IReferenceDataAgent { /// - /// Defines the ReferenceData HTTP agent. + /// Gets all of the items that match the filter arguments. /// - public partial interface IReferenceDataAgent - { - /// - /// Gets all of the items that match the filter arguments. - /// - /// The optional arguments. - /// The optional . - /// The . - /// A . - Task> CountryGetAllAsync(ReferenceDataFilter? args = null, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); + /// The optional arguments. + /// The optional . + /// The . + /// A . + Task> CountryGetAllAsync(ReferenceDataFilter? args = null, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); - /// - /// Gets all of the items that match the filter arguments. - /// - /// The optional arguments. - /// The optional . - /// The . - /// A . - Task> USStateGetAllAsync(ReferenceDataFilter? args = null, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); + /// + /// Gets all of the items that match the filter arguments. + /// + /// The optional arguments. + /// The optional . + /// The . + /// A . + Task> USStateGetAllAsync(ReferenceDataFilter? args = null, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); - /// - /// Gets all of the items that match the filter arguments. - /// - /// The optional arguments. - /// The optional . - /// The . - /// A . - Task> GenderGetAllAsync(ReferenceDataFilter? args = null, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); + /// + /// Gets all of the items that match the filter arguments. + /// + /// The optional arguments. + /// The optional . + /// The . + /// A . + Task> GenderGetAllAsync(ReferenceDataFilter? args = null, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); - /// - /// Gets all of the items that match the filter arguments. - /// - /// The optional arguments. - /// The optional . - /// The . - /// A . - Task> EyeColorGetAllAsync(ReferenceDataFilter? args = null, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); + /// + /// Gets all of the items that match the filter arguments. + /// + /// The optional arguments. + /// The optional . + /// The . + /// A . + Task> EyeColorGetAllAsync(ReferenceDataFilter? args = null, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); - /// - /// Gets all of the items that match the filter arguments. - /// - /// The optional arguments. - /// The optional . - /// The . - /// A . - Task> PowerSourceGetAllAsync(ReferenceDataFilter? args = null, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); + /// + /// Gets all of the items that match the filter arguments. + /// + /// The optional arguments. + /// The optional . + /// The . + /// A . + Task> PowerSourceGetAllAsync(ReferenceDataFilter? args = null, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); - /// - /// Gets all of the items that match the filter arguments. - /// - /// The optional arguments. - /// The optional . - /// The . - /// A . - Task> CompanyGetAllAsync(ReferenceDataFilter? args = null, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); + /// + /// Gets all of the items that match the filter arguments. + /// + /// The optional arguments. + /// The optional . + /// The . + /// A . + Task> CompanyGetAllAsync(ReferenceDataFilter? args = null, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); - /// - /// Gets all of the items that match the filter arguments. - /// - /// The optional arguments. - /// The optional . - /// The . - /// A . - Task> StatusGetAllAsync(ReferenceDataFilter? args = null, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); + /// + /// Gets all of the items that match the filter arguments. + /// + /// The optional arguments. + /// The optional . + /// The . + /// A . + Task> StatusGetAllAsync(ReferenceDataFilter? args = null, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); - /// - /// Gets all of the items that match the filter arguments. - /// - /// The optional arguments. - /// The optional . - /// The . - /// A . - Task> CommunicationTypeGetAllAsync(ReferenceDataFilter? args = null, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); + /// + /// Gets all of the items that match the filter arguments. + /// + /// The optional arguments. + /// The optional . + /// The . + /// A . + Task> CommunicationTypeGetAllAsync(ReferenceDataFilter? args = null, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); - /// - /// Gets the reference data entries for the specified entities and codes from the query string; e.g: api/v1/demo/ref?entity=codeX,codeY&entity2=codeZ&entity3 - /// - /// The optional list of reference data names. - /// The optional . - /// The . - /// A . - /// The reference data objects will need to be manually extracted from the corresponding response content. - Task GetNamedAsync(string[] names, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); - } + /// + /// Gets the reference data entries for the specified entities and codes from the query string; e.g: api/v1/demo/ref?entity=codeX,codeY&entity2=codeZ&entity3 + /// + /// The optional list of reference data names. + /// The optional . + /// The . + /// A . + /// The reference data objects will need to be manually extracted from the corresponding response content. + Task GetNamedAsync(string[] names, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); } #pragma warning restore diff --git a/samples/Demo/Beef.Demo.Common/Agents/Generated/IRobotAgent.cs b/samples/Demo/Beef.Demo.Common/Agents/Generated/IRobotAgent.cs index a3b2ba53d..ebf975de9 100644 --- a/samples/Demo/Beef.Demo.Common/Agents/Generated/IRobotAgent.cs +++ b/samples/Demo/Beef.Demo.Common/Agents/Generated/IRobotAgent.cs @@ -5,94 +5,80 @@ #nullable enable #pragma warning disable -using System; -using System.Collections.Generic; -using System.Net.Http; -using System.Threading; -using System.Threading.Tasks; -using CoreEx.Configuration; -using CoreEx.Entities; -using CoreEx.Http; -using CoreEx.Json; -using Microsoft.Extensions.Logging; -using Beef.Demo.Common.Entities; -using RefDataNamespace = Beef.Demo.Common.Entities; +namespace Beef.Demo.Common.Agents; -namespace Beef.Demo.Common.Agents +/// +/// Defines the HTTP agent. +/// +public partial interface IRobotAgent { /// - /// Defines the HTTP agent. + /// Get the R-O-B-O-T. /// - public partial interface IRobotAgent - { - /// - /// Get the R-O-B-O-T. - /// - /// The identifier. - /// The optional . - /// The . - /// A . - Task> GetAsync(Guid id, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); + /// The identifier. + /// The optional . + /// The . + /// A . + Task> GetAsync(Guid id, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); - /// - /// Creates a new . - /// - /// The . - /// The optional . - /// The . - /// A . - Task> CreateAsync(Robot value, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); + /// + /// Creates a new . + /// + /// The . + /// The optional . + /// The . + /// A . + Task> CreateAsync(Robot value, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); - /// - /// Updates an existing . - /// - /// The . - /// The identifier. - /// The optional . - /// The . - /// A . - Task> UpdateAsync(Robot value, Guid id, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); + /// + /// Updates an existing . + /// + /// The . + /// The identifier. + /// The optional . + /// The . + /// A . + Task> UpdateAsync(Robot value, Guid id, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); - /// - /// Patches an existing . - /// - /// The . - /// The that contains the patch content for the . - /// The identifier. - /// The optional . - /// The . - /// A . - Task> PatchAsync(HttpPatchOption patchOption, string value, Guid id, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); + /// + /// Patches an existing . + /// + /// The . + /// The that contains the patch content for the . + /// The identifier. + /// The optional . + /// The . + /// A . + Task> PatchAsync(HttpPatchOption patchOption, string value, Guid id, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); - /// - /// Deletes the specified . - /// - /// The identifier. - /// The optional . - /// The . - /// A . - Task DeleteAsync(Guid id, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); + /// + /// Deletes the specified . + /// + /// The identifier. + /// The optional . + /// The . + /// A . + Task DeleteAsync(Guid id, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); - /// - /// Gets the that contains the items that match the selection criteria. - /// - /// The Args (see ). - /// The . - /// The optional . - /// The . - /// A . - Task> GetByArgsAsync(RobotArgs? args, PagingArgs? paging = null, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); + /// + /// Gets the that contains the items that match the selection criteria. + /// + /// The Args (see ). + /// The . + /// The optional . + /// The . + /// A . + Task> GetByArgsAsync(RobotArgs? args, PagingArgs? paging = null, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); - /// - /// Raises a change event. - /// - /// The identifier. - /// The Power Source. - /// The optional . - /// The . - /// A . - Task RaisePowerSourceChangeAsync(Guid id, string? powerSource, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); - } + /// + /// Raises a change event. + /// + /// The identifier. + /// The Power Source. + /// The optional . + /// The . + /// A . + Task RaisePowerSourceChangeAsync(Guid id, string? powerSource, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); } #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 79d90e6f3..27a2549de 100644 --- a/samples/Demo/Beef.Demo.Common/Agents/Generated/PersonAgent.cs +++ b/samples/Demo/Beef.Demo.Common/Agents/Generated/PersonAgent.cs @@ -5,176 +5,164 @@ #nullable enable #pragma warning disable -using System; -using System.Collections.Generic; -using System.Net.Http; -using System.Threading; -using System.Threading.Tasks; -using CoreEx.Entities; -using CoreEx.Http; -using CoreEx.Json; -using Beef.Demo.Common.Entities; -using RefDataNamespace = Beef.Demo.Common.Entities; - -namespace Beef.Demo.Common.Agents +namespace Beef.Demo.Common.Agents; + +/// +/// Provides the HTTP agent. +/// +public partial class PersonAgent : TypedHttpClientBase, IPersonAgent { /// - /// Provides the HTTP agent. + /// Initializes a new instance of the class. /// - public partial class PersonAgent : TypedHttpClientBase, 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); - - /// - 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); - - /// - 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); - - /// - 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); - - /// - 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); - - /// - 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); - - /// - 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); - - /// - 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); - - /// - public Task> GetAll2Async(HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) - => GetAsync("api/v1/persons/allnopaging", requestOptions: requestOptions, cancellationToken: cancellationToken); - - /// - 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); - - /// - 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); - - /// - 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); - - /// - public Task MarkAsync(HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) - => PostAsync("api/v1/persons/mark", requestOptions: requestOptions, cancellationToken: cancellationToken); - - /// - 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); - - /// - public Task> GetNoArgsAsync(HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) - => GetAsync("api/v1/persons/noargsforme", requestOptions: requestOptions, cancellationToken: cancellationToken); - - /// - 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); - - /// - 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); - - /// - 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); - - /// - 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); - - /// - public Task Add2Async(Person person, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) - => PostAsync("api/v1/persons/acceptsBody", person, requestOptions: requestOptions, cancellationToken: cancellationToken); - - /// - public Task Add3Async(Person value, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) - => PostAsync("api/v1/persons/acceptsBodyValue", value, requestOptions: requestOptions, cancellationToken: cancellationToken); - - /// - public Task CustomManagerOnlyAsync(HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) - => PostAsync("api/v1/persons/cmo", requestOptions: requestOptions, cancellationToken: cancellationToken); - - /// - 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); - - /// - public Task> EventPublishNoSendAsync(Person value, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) - => PutAsync("api/v1/persons/publishnosend", value, requestOptions: 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); + /// 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); + + /// + 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); + + /// + 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); + + /// + 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); + + /// + 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); + + /// + 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); + + /// + 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); + + /// + 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); + + /// + public Task> GetAll2Async(HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) + => GetAsync("api/v1/persons/allnopaging", requestOptions: requestOptions, cancellationToken: cancellationToken); + + /// + 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); + + /// + 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); + + /// + 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); + + /// + public Task MarkAsync(HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) + => PostAsync("api/v1/persons/mark", requestOptions: requestOptions, cancellationToken: cancellationToken); + + /// + 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); + + /// + public Task> GetNoArgsAsync(HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) + => GetAsync("api/v1/persons/noargsforme", requestOptions: requestOptions, cancellationToken: cancellationToken); + + /// + 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); + + /// + 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); + + /// + 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); + + /// + 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); + + /// + public Task Add2Async(Person person, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) + => PostAsync("api/v1/persons/acceptsBody", person, requestOptions: requestOptions, cancellationToken: cancellationToken); + + /// + public Task Add3Async(Person value, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) + => PostAsync("api/v1/persons/acceptsBodyValue", value, requestOptions: requestOptions, cancellationToken: cancellationToken); + + /// + public Task CustomManagerOnlyAsync(HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) + => PostAsync("api/v1/persons/cmo", requestOptions: requestOptions, cancellationToken: cancellationToken); + + /// + 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); + + /// + public Task> EventPublishNoSendAsync(Person value, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) + => PutAsync("api/v1/persons/publishnosend", value, requestOptions: 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); - /// - public Task ThrowErrorAsync(HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) - => PostAsync("api/v1/persons/error", requestOptions: requestOptions, cancellationToken: cancellationToken); + /// + public Task ThrowErrorAsync(HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) + => PostAsync("api/v1/persons/error", requestOptions: requestOptions, cancellationToken: cancellationToken); - /// - 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); + /// + 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); - /// - 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); + /// + 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); - /// - 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); + /// + 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); - /// - public Task> CreateWithEfAsync(Person value, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) - => PostAsync("api/v1/persons/ef", value, requestOptions: requestOptions, cancellationToken: cancellationToken); + /// + public Task> CreateWithEfAsync(Person value, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) + => PostAsync("api/v1/persons/ef", value, requestOptions: 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); + /// + 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); - /// - 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); + /// + 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); - /// - 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); + /// + 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); - /// - 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); + /// + 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); - /// - 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); + /// + 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); - /// - 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); - } + /// + 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); } #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 5e18fec12..ad6641084 100644 --- a/samples/Demo/Beef.Demo.Common/Agents/Generated/PostalInfoAgent.cs +++ b/samples/Demo/Beef.Demo.Common/Agents/Generated/PostalInfoAgent.cs @@ -5,52 +5,40 @@ #nullable enable #pragma warning disable -using System; -using System.Collections.Generic; -using System.Net.Http; -using System.Threading; -using System.Threading.Tasks; -using CoreEx.Entities; -using CoreEx.Http; -using CoreEx.Json; -using Beef.Demo.Common.Entities; -using RefDataNamespace = Beef.Demo.Common.Entities; - -namespace Beef.Demo.Common.Agents +namespace Beef.Demo.Common.Agents; + +/// +/// Provides the HTTP agent. +/// +public partial class PostalInfoAgent : TypedHttpClientBase, IPostalInfoAgent { /// - /// Provides the HTTP agent. + /// Initializes a new instance of the class. /// - public partial class PostalInfoAgent : TypedHttpClientBase, 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); - - /// - 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); - - /// - 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); - - /// - 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); - - /// - 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); - } + /// 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); + + /// + 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); + + /// + 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); + + /// + 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); + + /// + 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); } #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 f2c96b01a..6550d601f 100644 --- a/samples/Demo/Beef.Demo.Common/Agents/Generated/ReferenceDataAgent.cs +++ b/samples/Demo/Beef.Demo.Common/Agents/Generated/ReferenceDataAgent.cs @@ -5,74 +5,61 @@ #nullable enable #pragma warning disable -using System; -using System.Collections.Generic; -using System.Net.Http; -using System.Threading; -using System.Threading.Tasks; -using CoreEx.Entities; -using CoreEx.Http; -using CoreEx.Json; -using CoreEx.RefData; -using Beef.Demo.Common.Entities; -using RefDataNamespace = Beef.Demo.Common.Entities; +namespace Beef.Demo.Common.Agents; -namespace Beef.Demo.Common.Agents +/// +/// Provides the ReferenceData HTTP agent. +/// +public partial class ReferenceDataAgent : TypedHttpClientBase, IReferenceDataAgent { /// - /// Provides the ReferenceData HTTP agent. + /// Initializes a new instance of the class. /// - public partial class ReferenceDataAgent : TypedHttpClientBase, 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) { } + /// 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); + /// + 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); - /// - 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); + /// + 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); - /// - 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); + /// + 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); - /// - 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); + /// + 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); - /// - 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); + /// + 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); - /// - 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); + /// + 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); - /// - 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); + /// + 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); - /// - 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); + /// + 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); - /// - public Task GetNamedAsync(string[] names, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) - { - var ro = requestOptions ?? new HttpRequestOptions(); - if (names != null) - ro.UrlQueryString += string.Join("&", names); - - return GetAsync("api/v1/demo/ref", ro, null, cancellationToken); - } + /// + public Task GetNamedAsync(string[] names, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) + { + var ro = requestOptions ?? new HttpRequestOptions(); + if (names != null) + ro.UrlQueryString += string.Join("&", names); + + return GetAsync("api/v1/demo/ref", ro, null, cancellationToken); } } diff --git a/samples/Demo/Beef.Demo.Common/Agents/Generated/RobotAgent.cs b/samples/Demo/Beef.Demo.Common/Agents/Generated/RobotAgent.cs index c3df84a4c..261a249dd 100644 --- a/samples/Demo/Beef.Demo.Common/Agents/Generated/RobotAgent.cs +++ b/samples/Demo/Beef.Demo.Common/Agents/Generated/RobotAgent.cs @@ -5,60 +5,48 @@ #nullable enable #pragma warning disable -using System; -using System.Collections.Generic; -using System.Net.Http; -using System.Threading; -using System.Threading.Tasks; -using CoreEx.Entities; -using CoreEx.Http; -using CoreEx.Json; -using Beef.Demo.Common.Entities; -using RefDataNamespace = Beef.Demo.Common.Entities; +namespace Beef.Demo.Common.Agents; -namespace Beef.Demo.Common.Agents +/// +/// Provides the HTTP agent. +/// +public partial class RobotAgent : TypedHttpClientBase, IRobotAgent { /// - /// Provides the HTTP agent. + /// Initializes a new instance of the class. /// - public partial class RobotAgent : TypedHttpClientBase, 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); - - /// - public Task> CreateAsync(Robot value, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) - => PostAsync("api/v1/robots", value, requestOptions: 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); - - /// - 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); - - /// - 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); - - /// - 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); - - /// - 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); - } + /// 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); + + /// + public Task> CreateAsync(Robot value, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) + => PostAsync("api/v1/robots", value, requestOptions: 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); + + /// + 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); + + /// + 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); + + /// + 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); + + /// + 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); } #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 608f72760..ce4a4d2c1 100644 --- a/samples/Demo/Beef.Demo.Common/Beef.Demo.Common.csproj +++ b/samples/Demo/Beef.Demo.Common/Beef.Demo.Common.csproj @@ -2,6 +2,8 @@ netstandard2.1 enable + Preview + true diff --git a/samples/Demo/Beef.Demo.Common/Entities/Generated/Address.cs b/samples/Demo/Beef.Demo.Common/Entities/Generated/Address.cs index 6308043eb..c94c7c466 100644 --- a/samples/Demo/Beef.Demo.Common/Entities/Generated/Address.cs +++ b/samples/Demo/Beef.Demo.Common/Entities/Generated/Address.cs @@ -5,35 +5,29 @@ #nullable enable #pragma warning disable -using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Text.Json.Serialization; -using CoreEx.Entities; +namespace Beef.Demo.Common.Entities; -namespace Beef.Demo.Common.Entities +/// +/// Represents the Address entity. +/// +public partial class Address { /// - /// Represents the Address entity. + /// Gets or sets the Street. /// - public partial class Address - { - /// - /// Gets or sets the Street. - /// - public string? Street { get; set; } - - /// - /// Gets or sets the City. - /// - public string? City { get; set; } - } + public string? Street { get; set; } /// - /// Represents the Address collection. + /// Gets or sets the City. /// - public partial class AddressCollection : List
{ } + public string? City { get; set; } } +/// +/// Represents the Address collection. +/// +public partial class AddressCollection : List
{ } + + #pragma warning restore #nullable restore \ No newline at end of file diff --git a/samples/Demo/Beef.Demo.Common/Entities/Generated/CommunicationType.cs b/samples/Demo/Beef.Demo.Common/Entities/Generated/CommunicationType.cs index 8ae43d87b..cdefd4788 100644 --- a/samples/Demo/Beef.Demo.Common/Entities/Generated/CommunicationType.cs +++ b/samples/Demo/Beef.Demo.Common/Entities/Generated/CommunicationType.cs @@ -5,25 +5,18 @@ #nullable enable #pragma warning disable -using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Text.Json.Serialization; -using CoreEx.Entities; -using CoreEx.RefData; +namespace Beef.Demo.Common.Entities; -namespace Beef.Demo.Common.Entities -{ - /// - /// Represents the Communication Type entity. - /// - public partial class CommunicationType : ReferenceDataBase { } +/// +/// Represents the Communication Type entity. +/// +public partial class CommunicationType : ReferenceDataBase { } + +/// +/// Represents the CommunicationType collection. +/// +public partial class CommunicationTypeCollection : List { } - /// - /// Represents the CommunicationType collection. - /// - public partial class CommunicationTypeCollection : List { } -} #pragma warning restore #nullable restore \ No newline at end of file diff --git a/samples/Demo/Beef.Demo.Common/Entities/Generated/Company.cs b/samples/Demo/Beef.Demo.Common/Entities/Generated/Company.cs index 53f22735a..7d265947e 100644 --- a/samples/Demo/Beef.Demo.Common/Entities/Generated/Company.cs +++ b/samples/Demo/Beef.Demo.Common/Entities/Generated/Company.cs @@ -5,31 +5,24 @@ #nullable enable #pragma warning disable -using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Text.Json.Serialization; -using CoreEx.Entities; -using CoreEx.RefData; +namespace Beef.Demo.Common.Entities; -namespace Beef.Demo.Common.Entities +/// +/// Represents the Company entity. +/// +public partial class Company : ReferenceDataBase { /// - /// Represents the Company entity. + /// Gets or sets the External Code. /// - public partial class Company : ReferenceDataBase - { - /// - /// Gets or sets the External Code. - /// - public string? ExternalCode { get; set; } - } - - /// - /// Represents the Company collection. - /// - public partial class CompanyCollection : List { } + public string? ExternalCode { get; set; } } +/// +/// Represents the Company collection. +/// +public partial class CompanyCollection : List { } + + #pragma warning restore #nullable restore \ No newline at end of file diff --git a/samples/Demo/Beef.Demo.Common/Entities/Generated/Contact.cs b/samples/Demo/Beef.Demo.Common/Entities/Generated/Contact.cs index a411a5a0a..2abd063fd 100644 --- a/samples/Demo/Beef.Demo.Common/Entities/Generated/Contact.cs +++ b/samples/Demo/Beef.Demo.Common/Entities/Generated/Contact.cs @@ -5,79 +5,73 @@ #nullable enable #pragma warning disable -using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Text.Json.Serialization; -using CoreEx.Entities; +namespace Beef.Demo.Common.Entities; -namespace Beef.Demo.Common.Entities +/// +/// Represents the Contact entity. +/// +public partial class Contact : IIdentifier { /// - /// Represents the Contact entity. + /// Gets or sets the Contact identifier. /// - public partial class Contact : IIdentifier - { - /// - /// Gets or sets the Contact identifier. - /// - public Guid Id { get; set; } + public Guid Id { get; set; } - /// - /// Gets or sets the First Name. - /// - public string? FirstName { get; set; } - - /// - /// Gets or sets the Last Name. - /// - public string? LastName { get; set; } + /// + /// Gets or sets the First Name. + /// + public string? FirstName { get; set; } - /// - /// Gets the corresponding Status text (read-only where selected). - /// - public string? StatusDescription { get; set; } + /// + /// Gets or sets the Last Name. + /// + public string? LastName { get; set; } - /// - /// Gets or sets the Status code. - /// - public string? Status { get; set; } + /// + /// Gets the corresponding Status text (read-only where selected). + /// + public string? StatusDescription { get; set; } - /// - /// Gets or sets the Communications. - /// - public ContactCommCollection? Communications { get; set; } - } + /// + /// Gets or sets the Status code. + /// + public string? Status { get; set; } /// - /// Represents the Contact collection. + /// Gets or sets the Communications. /// - public partial class ContactCollection : List { } + public ContactCommCollection? Communications { get; set; } +} + +/// +/// Represents the Contact collection. +/// +public partial class ContactCollection : List { } +/// +/// Represents the Contact collection result. +/// +public class ContactCollectionResult : CollectionResult +{ + /// + /// Initializes a new instance of the class. + /// + public ContactCollectionResult() { } + + /// + /// Initializes a new instance of the class with . + /// + /// The . + public ContactCollectionResult(PagingArgs? paging) : base(paging) { } + /// - /// Represents the Contact collection result. + /// Initializes a new instance of the class with to add. /// - public class ContactCollectionResult : CollectionResult - { - /// - /// Initializes a new instance of the class. - /// - public ContactCollectionResult() { } - - /// - /// Initializes a new instance of the class with . - /// - /// The . - public ContactCollectionResult(PagingArgs? paging) : base(paging) { } - - /// - /// Initializes a new instance of the class with to add. - /// - /// The items to add. - /// The . - public ContactCollectionResult(IEnumerable items, PagingArgs? paging = null) : base(paging) => Items.AddRange(items); - } + /// The items to add. + /// The . + public ContactCollectionResult(IEnumerable items, PagingArgs? paging = null) : base(paging) => Items.AddRange(items); } + #pragma warning restore #nullable restore \ No newline at end of file diff --git a/samples/Demo/Beef.Demo.Common/Entities/Generated/ContactComm.cs b/samples/Demo/Beef.Demo.Common/Entities/Generated/ContactComm.cs index 4da9295c3..4f3f0a90b 100644 --- a/samples/Demo/Beef.Demo.Common/Entities/Generated/ContactComm.cs +++ b/samples/Demo/Beef.Demo.Common/Entities/Generated/ContactComm.cs @@ -5,35 +5,29 @@ #nullable enable #pragma warning disable -using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Text.Json.Serialization; -using CoreEx.Entities; +namespace Beef.Demo.Common.Entities; -namespace Beef.Demo.Common.Entities +/// +/// Represents the Contact Comm entity. +/// +public partial class ContactComm { /// - /// Represents the Contact Comm entity. + /// Gets or sets the Value. /// - public partial class ContactComm - { - /// - /// Gets or sets the Value. - /// - public string? Value { get; set; } - - /// - /// Indicates whether Communication is the preferred (only one). - /// - public bool IsPreferred { get; set; } - } + public string? Value { get; set; } /// - /// Represents the ContactComm collection. + /// Indicates whether Communication is the preferred (only one). /// - public partial class ContactCommCollection : Dictionary { } + public bool IsPreferred { get; set; } } +/// +/// Represents the ContactComm collection. +/// +public partial class ContactCommCollection : Dictionary { } + + #pragma warning restore #nullable restore \ No newline at end of file diff --git a/samples/Demo/Beef.Demo.Common/Entities/Generated/Country.cs b/samples/Demo/Beef.Demo.Common/Entities/Generated/Country.cs index 3a7e74b5b..4d2049880 100644 --- a/samples/Demo/Beef.Demo.Common/Entities/Generated/Country.cs +++ b/samples/Demo/Beef.Demo.Common/Entities/Generated/Country.cs @@ -5,25 +5,18 @@ #nullable enable #pragma warning disable -using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Text.Json.Serialization; -using CoreEx.Entities; -using CoreEx.RefData; +namespace Beef.Demo.Common.Entities; -namespace Beef.Demo.Common.Entities -{ - /// - /// Represents the Country entity. - /// - public partial class Country : ReferenceDataBase { } +/// +/// Represents the Country entity. +/// +public partial class Country : ReferenceDataBase { } + +/// +/// Represents the Country collection. +/// +public partial class CountryCollection : List { } - /// - /// Represents the Country collection. - /// - public partial class CountryCollection : List { } -} #pragma warning restore #nullable restore \ No newline at end of file diff --git a/samples/Demo/Beef.Demo.Common/Entities/Generated/EyeColor.cs b/samples/Demo/Beef.Demo.Common/Entities/Generated/EyeColor.cs index f737391a5..7d0d844e7 100644 --- a/samples/Demo/Beef.Demo.Common/Entities/Generated/EyeColor.cs +++ b/samples/Demo/Beef.Demo.Common/Entities/Generated/EyeColor.cs @@ -5,25 +5,18 @@ #nullable enable #pragma warning disable -using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Text.Json.Serialization; -using CoreEx.Entities; -using CoreEx.RefData; +namespace Beef.Demo.Common.Entities; -namespace Beef.Demo.Common.Entities -{ - /// - /// Represents the Eye Color entity. - /// - public partial class EyeColor : ReferenceDataBase { } +/// +/// Represents the Eye Color entity. +/// +public partial class EyeColor : ReferenceDataBase { } + +/// +/// Represents the EyeColor collection. +/// +public partial class EyeColorCollection : List { } - /// - /// Represents the EyeColor collection. - /// - public partial class EyeColorCollection : List { } -} #pragma warning restore #nullable restore \ No newline at end of file diff --git a/samples/Demo/Beef.Demo.Common/Entities/Generated/Gender.cs b/samples/Demo/Beef.Demo.Common/Entities/Generated/Gender.cs index 23502b658..cb616c03c 100644 --- a/samples/Demo/Beef.Demo.Common/Entities/Generated/Gender.cs +++ b/samples/Demo/Beef.Demo.Common/Entities/Generated/Gender.cs @@ -5,42 +5,35 @@ #nullable enable #pragma warning disable -using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Text.Json.Serialization; -using CoreEx.Entities; -using CoreEx.RefData; - -namespace Beef.Demo.Common.Entities +namespace Beef.Demo.Common.Entities; + +/// +/// Represents the Gender entity. +/// +public partial class Gender : ReferenceDataBase { /// - /// Represents the Gender entity. + /// Gets or sets the Alternate Name. + /// + public string? AlternateName { get; set; } + + /// + /// Gets or sets the Trip OData Code. /// - public partial class Gender : ReferenceDataBase - { - /// - /// Gets or sets the Alternate Name. - /// - public string? AlternateName { get; set; } - - /// - /// Gets or sets the Trip OData Code. - /// - [JsonIgnore] - public string? TripCode { get; set; } - - /// - /// Gets or sets the Country code. - /// - public string? Country { get; set; } - } + [JsonIgnore] + public string? TripCode { get; set; } /// - /// Represents the Gender collection. + /// Gets or sets the Country code. /// - public partial class GenderCollection : List { } + public string? Country { get; set; } } +/// +/// Represents the Gender collection. +/// +public partial class GenderCollection : List { } + + #pragma warning restore #nullable restore \ No newline at end of file diff --git a/samples/Demo/Beef.Demo.Common/Entities/Generated/MapArgs.cs b/samples/Demo/Beef.Demo.Common/Entities/Generated/MapArgs.cs index c35b82e60..6db5e5688 100644 --- a/samples/Demo/Beef.Demo.Common/Entities/Generated/MapArgs.cs +++ b/samples/Demo/Beef.Demo.Common/Entities/Generated/MapArgs.cs @@ -5,25 +5,19 @@ #nullable enable #pragma warning disable -using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Text.Json.Serialization; -using CoreEx.Entities; +namespace Beef.Demo.Common.Entities; -namespace Beef.Demo.Common.Entities +/// +/// Represents the Mapping arguments entity. +/// +public partial class MapArgs { /// - /// Represents the Mapping arguments entity. + /// Gets or sets the Coordinates. /// - public partial class MapArgs - { - /// - /// Gets or sets the Coordinates. - /// - public MapCoordinates? Coordinates { get; set; } - } + public MapCoordinates? Coordinates { get; set; } } + #pragma warning restore #nullable restore \ No newline at end of file diff --git a/samples/Demo/Beef.Demo.Common/Entities/Generated/MapCoordinates.cs b/samples/Demo/Beef.Demo.Common/Entities/Generated/MapCoordinates.cs index 2b89dc7cc..01828054a 100644 --- a/samples/Demo/Beef.Demo.Common/Entities/Generated/MapCoordinates.cs +++ b/samples/Demo/Beef.Demo.Common/Entities/Generated/MapCoordinates.cs @@ -5,30 +5,24 @@ #nullable enable #pragma warning disable -using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Text.Json.Serialization; -using CoreEx.Entities; +namespace Beef.Demo.Common.Entities; -namespace Beef.Demo.Common.Entities +/// +/// Represents the Map Coordinates entity. +/// +public partial class MapCoordinates { /// - /// Represents the Map Coordinates entity. + /// Gets or sets the Latitude. /// - public partial class MapCoordinates - { - /// - /// Gets or sets the Latitude. - /// - public decimal Latitude { get; set; } + public decimal Latitude { get; set; } - /// - /// Gets or sets the Longitude. - /// - public decimal Longitude { get; set; } - } + /// + /// Gets or sets the Longitude. + /// + public decimal Longitude { get; set; } } + #pragma warning restore #nullable restore \ No newline at end of file diff --git a/samples/Demo/Beef.Demo.Common/Entities/Generated/Person.cs b/samples/Demo/Beef.Demo.Common/Entities/Generated/Person.cs index 85a48bcf2..fe50f7374 100644 --- a/samples/Demo/Beef.Demo.Common/Entities/Generated/Person.cs +++ b/samples/Demo/Beef.Demo.Common/Entities/Generated/Person.cs @@ -5,116 +5,110 @@ #nullable enable #pragma warning disable -using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Text.Json.Serialization; -using CoreEx.Entities; +namespace Beef.Demo.Common.Entities; -namespace Beef.Demo.Common.Entities +/// +/// Represents the Person entity. +/// +public partial class Person : IIdentifier, IETag, IChangeLog { /// - /// Represents the Person entity. - /// - public partial class Person : IIdentifier, IETag, IChangeLog - { - /// - /// Gets or sets the Person identifier. - /// - [System.Xml.Serialization.XmlElement("Id")] - public Guid Id { get; set; } - - /// - /// Gets or sets the First Name. - /// - public string? FirstName { get; set; } - - /// - /// Gets or sets the Last Name. - /// - public string? LastName { get; set; } - - /// - /// Gets or sets the Unique Code. - /// - public string? UniqueCode { get; set; } - - /// - /// Gets the corresponding Gender text (read-only where selected). - /// - public string? GenderText { get; set; } - - /// - /// Gets or sets the Gender code. - /// - public string? Gender { get; set; } - - /// - /// Gets the corresponding EyeColor text (read-only where selected). - /// - public string? EyeColorText { get; set; } - - /// - /// Gets or sets the Eye Color code. - /// - public string? EyeColor { get; set; } - - /// - /// Gets or sets the Birthday. - /// - public DateTime Birthday { get; set; } - - /// - /// Gets or sets the Address. - /// - public Address? Address { get; set; } - - /// - /// Gets or sets the ETag. - /// - [JsonPropertyName("etag")] - public string? ETag { get; set; } - - /// - /// Gets or sets the Metadata. - /// - public Dictionary? Metadata { get; set; } - - /// - /// Gets or sets the Change Log. - /// - public ChangeLog? ChangeLog { get; set; } - } - - /// - /// Represents the Person collection. - /// - public partial class PersonCollection : List { } - - /// - /// Represents the Person collection result. - /// - public class PersonCollectionResult : CollectionResult - { - /// - /// Initializes a new instance of the class. - /// - public PersonCollectionResult() { } - - /// - /// Initializes a new instance of the class with . - /// - /// The . - public PersonCollectionResult(PagingArgs? paging) : base(paging) { } - - /// - /// Initializes a new instance of the class with to add. - /// - /// The items to add. - /// The . - public PersonCollectionResult(IEnumerable items, PagingArgs? paging = null) : base(paging) => Items.AddRange(items); - } + /// Gets or sets the Person identifier. + /// + [System.Xml.Serialization.XmlElement("Id")] + public Guid Id { get; set; } + + /// + /// Gets or sets the First Name. + /// + public string? FirstName { get; set; } + + /// + /// Gets or sets the Last Name. + /// + public string? LastName { get; set; } + + /// + /// Gets or sets the Unique Code. + /// + public string? UniqueCode { get; set; } + + /// + /// Gets the corresponding Gender text (read-only where selected). + /// + public string? GenderText { get; set; } + + /// + /// Gets or sets the Gender code. + /// + public string? Gender { get; set; } + + /// + /// Gets the corresponding EyeColor text (read-only where selected). + /// + public string? EyeColorText { get; set; } + + /// + /// Gets or sets the Eye Color code. + /// + public string? EyeColor { get; set; } + + /// + /// Gets or sets the Birthday. + /// + public DateTime Birthday { get; set; } + + /// + /// Gets or sets the Address. + /// + public Address? Address { get; set; } + + /// + /// Gets or sets the ETag. + /// + [JsonPropertyName("etag")] + public string? ETag { get; set; } + + /// + /// Gets or sets the Metadata. + /// + public Dictionary? Metadata { get; set; } + + /// + /// Gets or sets the Change Log. + /// + public ChangeLog? ChangeLog { get; set; } +} + +/// +/// Represents the Person collection. +/// +public partial class PersonCollection : List { } + +/// +/// Represents the Person collection result. +/// +public class PersonCollectionResult : CollectionResult +{ + /// + /// Initializes a new instance of the class. + /// + public PersonCollectionResult() { } + + /// + /// Initializes a new instance of the class with . + /// + /// The . + public PersonCollectionResult(PagingArgs? paging) : base(paging) { } + + /// + /// Initializes a new instance of the class with to add. + /// + /// The items to add. + /// The . + public PersonCollectionResult(IEnumerable items, PagingArgs? paging = null) : base(paging) => Items.AddRange(items); } + #pragma warning restore #nullable restore \ No newline at end of file diff --git a/samples/Demo/Beef.Demo.Common/Entities/Generated/PersonArgs.cs b/samples/Demo/Beef.Demo.Common/Entities/Generated/PersonArgs.cs index c68287e84..7b3208065 100644 --- a/samples/Demo/Beef.Demo.Common/Entities/Generated/PersonArgs.cs +++ b/samples/Demo/Beef.Demo.Common/Entities/Generated/PersonArgs.cs @@ -5,40 +5,34 @@ #nullable enable #pragma warning disable -using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Text.Json.Serialization; -using CoreEx.Entities; +namespace Beef.Demo.Common.Entities; -namespace Beef.Demo.Common.Entities +/// +/// Represents the Person arguments entity. +/// +public partial class PersonArgs { /// - /// Represents the Person arguments entity. + /// Gets or sets the First Name. /// - public partial class PersonArgs - { - /// - /// Gets or sets the First Name. - /// - public string? FirstName { get; set; } - - /// - /// Gets or sets the Last Name. - /// - public string? LastName { get; set; } - - /// - /// Gets or sets the Genders code(s). - /// - public List? Genders { get; set; } - - /// - /// Gets or sets the Order By. - /// - public Common.Entities.OrderBy? OrderBy { get; set; } - } + public string? FirstName { get; set; } + + /// + /// Gets or sets the Last Name. + /// + public string? LastName { get; set; } + + /// + /// Gets or sets the Genders code(s). + /// + public List? Genders { get; set; } + + /// + /// Gets or sets the Order By. + /// + public Common.Entities.OrderBy? OrderBy { get; set; } } + #pragma warning restore #nullable restore \ No newline at end of file diff --git a/samples/Demo/Beef.Demo.Common/Entities/Generated/PersonDetail.cs b/samples/Demo/Beef.Demo.Common/Entities/Generated/PersonDetail.cs index b369ce766..126ede27f 100644 --- a/samples/Demo/Beef.Demo.Common/Entities/Generated/PersonDetail.cs +++ b/samples/Demo/Beef.Demo.Common/Entities/Generated/PersonDetail.cs @@ -5,54 +5,48 @@ #nullable enable #pragma warning disable -using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Text.Json.Serialization; -using CoreEx.Entities; +namespace Beef.Demo.Common.Entities; -namespace Beef.Demo.Common.Entities +/// +/// Represents the Person detail entity. +/// +public partial class PersonDetail : Person { /// - /// Represents the Person detail entity. + /// Gets or sets the History. /// - public partial class PersonDetail : Person - { - /// - /// Gets or sets the History. - /// - public WorkHistoryCollection? History { get; set; } - } + public WorkHistoryCollection? History { get; set; } +} + +/// +/// Represents the PersonDetail collection. +/// +public partial class PersonDetailCollection : List { } +/// +/// Represents the PersonDetail collection result. +/// +public class PersonDetailCollectionResult : CollectionResult +{ /// - /// Represents the PersonDetail collection. + /// Initializes a new instance of the class. /// - public partial class PersonDetailCollection : List { } - + public PersonDetailCollectionResult() { } + /// - /// Represents the PersonDetail collection result. + /// Initializes a new instance of the class with . /// - public class PersonDetailCollectionResult : CollectionResult - { - /// - /// Initializes a new instance of the class. - /// - public PersonDetailCollectionResult() { } - - /// - /// Initializes a new instance of the class with . - /// - /// The . - public PersonDetailCollectionResult(PagingArgs? paging) : base(paging) { } - - /// - /// Initializes a new instance of the class with to add. - /// - /// The items to add. - /// The . - public PersonDetailCollectionResult(IEnumerable items, PagingArgs? paging = null) : base(paging) => Items.AddRange(items); - } + /// The . + public PersonDetailCollectionResult(PagingArgs? paging) : base(paging) { } + + /// + /// Initializes a new instance of the class with to add. + /// + /// The items to add. + /// The . + public PersonDetailCollectionResult(IEnumerable items, PagingArgs? paging = null) : base(paging) => Items.AddRange(items); } + #pragma warning restore #nullable restore \ No newline at end of file diff --git a/samples/Demo/Beef.Demo.Common/Entities/Generated/PersonOther.cs b/samples/Demo/Beef.Demo.Common/Entities/Generated/PersonOther.cs index d1923055e..eabb7264a 100644 --- a/samples/Demo/Beef.Demo.Common/Entities/Generated/PersonOther.cs +++ b/samples/Demo/Beef.Demo.Common/Entities/Generated/PersonOther.cs @@ -5,51 +5,45 @@ #nullable enable #pragma warning disable -using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Text.Json.Serialization; -using CoreEx.Entities; +namespace Beef.Demo.Common.Entities; -namespace Beef.Demo.Common.Entities +/// +/// Represents the other Person without EntityBase capabilities entity. +/// +public partial class PersonOther : IIdentifier, IETag, IChangeLog { /// - /// Represents the other Person without EntityBase capabilities entity. + /// Gets or sets the Person identifier. /// - public partial class PersonOther : IIdentifier, IETag, IChangeLog - { - /// - /// Gets or sets the Person identifier. - /// - public Guid Id { get; set; } - - /// - /// Gets or sets the First Name. - /// - public string? FirstName { get; set; } - - /// - /// Gets or sets the Last Name. - /// - public string? LastName { get; set; } - - /// - /// Gets or sets the ETag. - /// - [JsonPropertyName("etag")] - public string? ETag { get; set; } - - /// - /// Gets or sets the Change Log. - /// - public ChangeLog? ChangeLog { get; set; } - } + public Guid Id { get; set; } /// - /// Represents the PersonOther collection. + /// Gets or sets the First Name. /// - public partial class PersonOtherCollection : List { } + public string? FirstName { get; set; } + + /// + /// Gets or sets the Last Name. + /// + public string? LastName { get; set; } + + /// + /// Gets or sets the ETag. + /// + [JsonPropertyName("etag")] + public string? ETag { get; set; } + + /// + /// Gets or sets the Change Log. + /// + public ChangeLog? ChangeLog { get; set; } } +/// +/// Represents the PersonOther collection. +/// +public partial class PersonOtherCollection : List { } + + #pragma warning restore #nullable restore \ No newline at end of file diff --git a/samples/Demo/Beef.Demo.Common/Entities/Generated/PlaceInfo.cs b/samples/Demo/Beef.Demo.Common/Entities/Generated/PlaceInfo.cs index f2406e39d..524240ffb 100644 --- a/samples/Demo/Beef.Demo.Common/Entities/Generated/PlaceInfo.cs +++ b/samples/Demo/Beef.Demo.Common/Entities/Generated/PlaceInfo.cs @@ -5,35 +5,29 @@ #nullable enable #pragma warning disable -using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Text.Json.Serialization; -using CoreEx.Entities; +namespace Beef.Demo.Common.Entities; -namespace Beef.Demo.Common.Entities +/// +/// Represents the Place Info entity. +/// +public partial class PlaceInfo { /// - /// Represents the Place Info entity. + /// Gets or sets the Name. /// - public partial class PlaceInfo - { - /// - /// Gets or sets the Name. - /// - public string? Name { get; set; } - - /// - /// Gets or sets the Post Code. - /// - public string? PostCode { get; set; } - } + public string? Name { get; set; } /// - /// Represents the PlaceInfo collection. + /// Gets or sets the Post Code. /// - public partial class PlaceInfoCollection : List { } + public string? PostCode { get; set; } } +/// +/// Represents the PlaceInfo collection. +/// +public partial class PlaceInfoCollection : List { } + + #pragma warning restore #nullable restore \ No newline at end of file diff --git a/samples/Demo/Beef.Demo.Common/Entities/Generated/PostalInfo.cs b/samples/Demo/Beef.Demo.Common/Entities/Generated/PostalInfo.cs index 97db3849e..4eb251460 100644 --- a/samples/Demo/Beef.Demo.Common/Entities/Generated/PostalInfo.cs +++ b/samples/Demo/Beef.Demo.Common/Entities/Generated/PostalInfo.cs @@ -5,45 +5,39 @@ #nullable enable #pragma warning disable -using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Text.Json.Serialization; -using CoreEx.Entities; +namespace Beef.Demo.Common.Entities; -namespace Beef.Demo.Common.Entities +/// +/// Represents the Postal Info entity. +/// +public partial class PostalInfo { /// - /// Represents the Postal Info entity. + /// Gets the corresponding Country text (read-only where selected). /// - public partial class PostalInfo - { - /// - /// Gets the corresponding Country text (read-only where selected). - /// - public string? CountryText { get; set; } - - /// - /// Gets or sets the Country code. - /// - public string? Country { get; set; } - - /// - /// Gets or sets the City. - /// - public string? City { get; set; } - - /// - /// Gets or sets the State. - /// - public string? State { get; set; } - - /// - /// Gets or sets the Places. - /// - public PlaceInfoCollection? Places { get; set; } - } + public string? CountryText { get; set; } + + /// + /// Gets or sets the Country code. + /// + public string? Country { get; set; } + + /// + /// Gets or sets the City. + /// + public string? City { get; set; } + + /// + /// Gets or sets the State. + /// + public string? State { get; set; } + + /// + /// Gets or sets the Places. + /// + public PlaceInfoCollection? Places { get; set; } } + #pragma warning restore #nullable restore \ No newline at end of file diff --git a/samples/Demo/Beef.Demo.Common/Entities/Generated/PowerSource.cs b/samples/Demo/Beef.Demo.Common/Entities/Generated/PowerSource.cs index 74ba69255..f7902dc35 100644 --- a/samples/Demo/Beef.Demo.Common/Entities/Generated/PowerSource.cs +++ b/samples/Demo/Beef.Demo.Common/Entities/Generated/PowerSource.cs @@ -5,31 +5,24 @@ #nullable enable #pragma warning disable -using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Text.Json.Serialization; -using CoreEx.Entities; -using CoreEx.RefData; +namespace Beef.Demo.Common.Entities; -namespace Beef.Demo.Common.Entities +/// +/// Represents the Power Source entity. +/// +public partial class PowerSource : ReferenceDataBase { /// - /// Represents the Power Source entity. + /// Gets or sets the Additional Info. /// - public partial class PowerSource : ReferenceDataBase - { - /// - /// Gets or sets the Additional Info. - /// - public string? AdditionalInfo { get; set; } - } - - /// - /// Represents the PowerSource collection. - /// - public partial class PowerSourceCollection : List { } + public string? AdditionalInfo { get; set; } } +/// +/// Represents the PowerSource collection. +/// +public partial class PowerSourceCollection : List { } + + #pragma warning restore #nullable restore \ No newline at end of file diff --git a/samples/Demo/Beef.Demo.Common/Entities/Generated/ProductArgs.cs b/samples/Demo/Beef.Demo.Common/Entities/Generated/ProductArgs.cs index 968698e7d..00ff4117c 100644 --- a/samples/Demo/Beef.Demo.Common/Entities/Generated/ProductArgs.cs +++ b/samples/Demo/Beef.Demo.Common/Entities/Generated/ProductArgs.cs @@ -5,30 +5,24 @@ #nullable enable #pragma warning disable -using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Text.Json.Serialization; -using CoreEx.Entities; +namespace Beef.Demo.Common.Entities; -namespace Beef.Demo.Common.Entities +/// +/// The Product arguments. +/// +public partial class ProductArgs { /// - /// The Product arguments. + /// The product name. /// - public partial class ProductArgs - { - /// - /// The product name. - /// - public string? Name { get; set; } + public string? Name { get; set; } - /// - /// Gets or sets the Description. - /// - public string? Description { get; set; } - } + /// + /// Gets or sets the Description. + /// + public string? Description { get; set; } } + #pragma warning restore #nullable restore \ No newline at end of file diff --git a/samples/Demo/Beef.Demo.Common/Entities/Generated/RefDataPrimaryKey.cs b/samples/Demo/Beef.Demo.Common/Entities/Generated/RefDataPrimaryKey.cs index 3489c6bee..6bcc21808 100644 --- a/samples/Demo/Beef.Demo.Common/Entities/Generated/RefDataPrimaryKey.cs +++ b/samples/Demo/Beef.Demo.Common/Entities/Generated/RefDataPrimaryKey.cs @@ -5,48 +5,42 @@ #nullable enable #pragma warning disable -using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Text.Json.Serialization; -using CoreEx.Entities; +namespace Beef.Demo.Common.Entities; -namespace Beef.Demo.Common.Entities +/// +/// Represents the Ref Data Primary Key entity. +/// +public partial class RefDataPrimaryKey : IPrimaryKey { /// - /// Represents the Ref Data Primary Key entity. + /// Gets the corresponding Key1 text (read-only where selected). /// - public partial class RefDataPrimaryKey : IPrimaryKey - { - /// - /// Gets the corresponding Key1 text (read-only where selected). - /// - public string? Key1Text { get; set; } - - /// - /// Gets or sets the Key1 code. - /// - public string? Key1 { get; set; } - - /// - /// Gets or sets the Other. - /// - public string? Other { get; set; } + public string? Key1Text { get; set; } + + /// + /// Gets or sets the Key1 code. + /// + public string? Key1 { get; set; } + + /// + /// Gets or sets the Other. + /// + public string? Other { get; set; } - /// - /// Creates the primary . - /// - /// The primary . - /// The . + /// + /// Creates the primary . + /// + /// The primary . + /// The . public static CompositeKey CreatePrimaryKey(string? key1) => CompositeKey.Create(key1); - /// - /// Gets the primary (consists of the following property(s): ). - /// - [JsonIgnore] - public CompositeKey PrimaryKey => CreatePrimaryKey(Key1); - } + /// + /// Gets the primary (consists of the following property(s): ). + /// + [JsonIgnore] + public CompositeKey PrimaryKey => CreatePrimaryKey(Key1); } + #pragma warning restore #nullable restore \ No newline at end of file diff --git a/samples/Demo/Beef.Demo.Common/Entities/Generated/Robot.cs b/samples/Demo/Beef.Demo.Common/Entities/Generated/Robot.cs index deeb9cd72..109065df1 100644 --- a/samples/Demo/Beef.Demo.Common/Entities/Generated/Robot.cs +++ b/samples/Demo/Beef.Demo.Common/Entities/Generated/Robot.cs @@ -5,95 +5,89 @@ #nullable enable #pragma warning disable -using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Text.Json.Serialization; -using CoreEx.Entities; +namespace Beef.Demo.Common.Entities; -namespace Beef.Demo.Common.Entities +/// +/// Represents the Robot entity. +/// +public partial class Robot : IIdentifier, IETag, IChangeLog { /// - /// Represents the Robot entity. + /// Gets or sets the Robot identifier. /// - public partial class Robot : IIdentifier, IETag, IChangeLog - { - /// - /// Gets or sets the Robot identifier. - /// - public Guid Id { get; set; } + public Guid Id { get; set; } - /// - /// Gets or sets the Model number. - /// - public string? ModelNo { get; set; } - - /// - /// Gets or sets the Unique serial number. - /// - public string? SerialNo { get; set; } + /// + /// Gets or sets the Model number. + /// + public string? ModelNo { get; set; } - /// - /// Gets the corresponding EyeColor text (read-only where selected). - /// - public string? EyeColorText { get; set; } + /// + /// Gets or sets the Unique serial number. + /// + public string? SerialNo { get; set; } - /// - /// Gets or sets the Eye Color code. - /// - public string? EyeColor { get; set; } + /// + /// Gets the corresponding EyeColor text (read-only where selected). + /// + public string? EyeColorText { get; set; } - /// - /// Gets the corresponding PowerSource text (read-only where selected). - /// - public string? PowerSourceText { get; set; } + /// + /// Gets or sets the Eye Color code. + /// + public string? EyeColor { get; set; } - /// - /// Gets or sets the Power Source code. - /// - public string? PowerSource { get; set; } + /// + /// Gets the corresponding PowerSource text (read-only where selected). + /// + public string? PowerSourceText { get; set; } - /// - /// Gets or sets the ETag. - /// - [JsonPropertyName("etag")] - public string? ETag { get; set; } + /// + /// Gets or sets the Power Source code. + /// + public string? PowerSource { get; set; } - /// - /// Gets or sets the Change Log. - /// - public ChangeLog? ChangeLog { get; set; } - } + /// + /// Gets or sets the ETag. + /// + [JsonPropertyName("etag")] + public string? ETag { get; set; } /// - /// Represents the Robot collection. + /// Gets or sets the Change Log. /// - public partial class RobotCollection : List { } + public ChangeLog? ChangeLog { get; set; } +} + +/// +/// Represents the Robot collection. +/// +public partial class RobotCollection : List { } +/// +/// Represents the Robot collection result. +/// +public class RobotCollectionResult : CollectionResult +{ /// - /// Represents the Robot collection result. + /// Initializes a new instance of the class. /// - public class RobotCollectionResult : CollectionResult - { - /// - /// Initializes a new instance of the class. - /// - public RobotCollectionResult() { } - - /// - /// Initializes a new instance of the class with . - /// - /// The . - public RobotCollectionResult(PagingArgs? paging) : base(paging) { } - - /// - /// Initializes a new instance of the class with to add. - /// - /// The items to add. - /// The . - public RobotCollectionResult(IEnumerable items, PagingArgs? paging = null) : base(paging) => Items.AddRange(items); - } + public RobotCollectionResult() { } + + /// + /// Initializes a new instance of the class with . + /// + /// The . + public RobotCollectionResult(PagingArgs? paging) : base(paging) { } + + /// + /// Initializes a new instance of the class with to add. + /// + /// The items to add. + /// The . + public RobotCollectionResult(IEnumerable items, PagingArgs? paging = null) : base(paging) => Items.AddRange(items); } + #pragma warning restore #nullable restore \ No newline at end of file diff --git a/samples/Demo/Beef.Demo.Common/Entities/Generated/RobotArgs.cs b/samples/Demo/Beef.Demo.Common/Entities/Generated/RobotArgs.cs index bfe4e0f3d..678c147fa 100644 --- a/samples/Demo/Beef.Demo.Common/Entities/Generated/RobotArgs.cs +++ b/samples/Demo/Beef.Demo.Common/Entities/Generated/RobotArgs.cs @@ -5,38 +5,32 @@ #nullable enable #pragma warning disable -using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Text.Json.Serialization; -using CoreEx.Entities; +namespace Beef.Demo.Common.Entities; -namespace Beef.Demo.Common.Entities +/// +/// Represents the Robot arguments entity. +/// +public partial class RobotArgs { /// - /// Represents the Robot arguments entity. + /// Gets or sets the Model number. /// - public partial class RobotArgs - { - /// - /// Gets or sets the Model number. - /// - [JsonPropertyName("model-no")] - public string? ModelNo { get; set; } + [JsonPropertyName("model-no")] + public string? ModelNo { get; set; } - /// - /// Gets or sets the Unique serial number. - /// - [JsonPropertyName("serial-no")] - public string? SerialNo { get; set; } + /// + /// Gets or sets the Unique serial number. + /// + [JsonPropertyName("serial-no")] + public string? SerialNo { get; set; } - /// - /// Gets or sets the Power Sources code(s). - /// - [JsonPropertyName("power-sources")] - public List? PowerSources { get; set; } - } + /// + /// Gets or sets the Power Sources code(s). + /// + [JsonPropertyName("power-sources")] + public List? PowerSources { get; set; } } + #pragma warning restore #nullable restore \ No newline at end of file diff --git a/samples/Demo/Beef.Demo.Common/Entities/Generated/Status.cs b/samples/Demo/Beef.Demo.Common/Entities/Generated/Status.cs index 76aab6075..2b5b7f7b3 100644 --- a/samples/Demo/Beef.Demo.Common/Entities/Generated/Status.cs +++ b/samples/Demo/Beef.Demo.Common/Entities/Generated/Status.cs @@ -5,25 +5,18 @@ #nullable enable #pragma warning disable -using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Text.Json.Serialization; -using CoreEx.Entities; -using CoreEx.RefData; +namespace Beef.Demo.Common.Entities; -namespace Beef.Demo.Common.Entities -{ - /// - /// Represents the Status entity. - /// - public partial class Status : ReferenceDataBase { } +/// +/// Represents the Status entity. +/// +public partial class Status : ReferenceDataBase { } + +/// +/// Represents the Status collection. +/// +public partial class StatusCollection : List { } - /// - /// Represents the Status collection. - /// - public partial class StatusCollection : List { } -} #pragma warning restore #nullable restore \ No newline at end of file diff --git a/samples/Demo/Beef.Demo.Common/Entities/Generated/USState.cs b/samples/Demo/Beef.Demo.Common/Entities/Generated/USState.cs index 1d0d270b1..2e8265998 100644 --- a/samples/Demo/Beef.Demo.Common/Entities/Generated/USState.cs +++ b/samples/Demo/Beef.Demo.Common/Entities/Generated/USState.cs @@ -5,25 +5,18 @@ #nullable enable #pragma warning disable -using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Text.Json.Serialization; -using CoreEx.Entities; -using CoreEx.RefData; +namespace Beef.Demo.Common.Entities; -namespace Beef.Demo.Common.Entities -{ - /// - /// Represents the US State entity. - /// - public partial class USState : ReferenceDataBase { } +/// +/// Represents the US State entity. +/// +public partial class USState : ReferenceDataBase { } + +/// +/// Represents the USState collection. +/// +public partial class USStateCollection : List { } - /// - /// Represents the USState collection. - /// - public partial class USStateCollection : List { } -} #pragma warning restore #nullable restore \ No newline at end of file diff --git a/samples/Demo/Beef.Demo.Common/Entities/Generated/WorkHistory.cs b/samples/Demo/Beef.Demo.Common/Entities/Generated/WorkHistory.cs index d5480cde4..eedc7d643 100644 --- a/samples/Demo/Beef.Demo.Common/Entities/Generated/WorkHistory.cs +++ b/samples/Demo/Beef.Demo.Common/Entities/Generated/WorkHistory.cs @@ -5,60 +5,54 @@ #nullable enable #pragma warning disable -using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Text.Json.Serialization; -using CoreEx.Entities; +namespace Beef.Demo.Common.Entities; -namespace Beef.Demo.Common.Entities +/// +/// Represents the Work History entity. +/// +public partial class WorkHistory : IPrimaryKey { /// - /// Represents the Work History entity. + /// Gets or sets the Person identifier (not serialized/read-only for internal data merging). /// - public partial class WorkHistory : IPrimaryKey - { - /// - /// Gets or sets the Person identifier (not serialized/read-only for internal data merging). - /// - [JsonIgnore] - public Guid PersonId { get; set; } + [JsonIgnore] + public Guid PersonId { get; set; } - /// - /// Gets or sets the Name. - /// - [JsonIgnore(Condition = JsonIgnoreCondition.Never)] - public string? Name { get; set; } + /// + /// Gets or sets the Name. + /// + [JsonIgnore(Condition = JsonIgnoreCondition.Never)] + public string? Name { get; set; } - /// - /// Gets or sets the Start Date. - /// - public DateTime StartDate { get; set; } + /// + /// Gets or sets the Start Date. + /// + public DateTime StartDate { get; set; } - /// - /// Gets or sets the End Date. - /// - public DateTime? EndDate { get; set; } + /// + /// Gets or sets the End Date. + /// + public DateTime? EndDate { get; set; } - /// - /// Creates the primary . - /// - /// The primary . - /// The . + /// + /// Creates the primary . + /// + /// The primary . + /// The . public static CompositeKey CreatePrimaryKey(string? name) => CompositeKey.Create(name); - /// - /// Gets the primary (consists of the following property(s): ). - /// - [JsonIgnore] - public CompositeKey PrimaryKey => CreatePrimaryKey(Name); - } - /// - /// Represents the WorkHistory collection. + /// Gets the primary (consists of the following property(s): ). /// - public partial class WorkHistoryCollection : List { } + [JsonIgnore] + public CompositeKey PrimaryKey => CreatePrimaryKey(Name); } +/// +/// Represents the WorkHistory collection. +/// +public partial class WorkHistoryCollection : List { } + + #pragma warning restore #nullable restore \ No newline at end of file diff --git a/samples/Demo/Beef.Demo.Common/GlobalUsings.cs b/samples/Demo/Beef.Demo.Common/GlobalUsings.cs new file mode 100644 index 000000000..b3f685a1c --- /dev/null +++ b/samples/Demo/Beef.Demo.Common/GlobalUsings.cs @@ -0,0 +1,13 @@ +global using CoreEx.Entities; +global using CoreEx.Http; +global using CoreEx.Json; +global using CoreEx.RefData; +global using System; +global using System.Collections.Generic; +global using System.Diagnostics.CodeAnalysis; +global using System.Text.Json.Serialization; +global using System.Net.Http; +global using System.Threading; +global using System.Threading.Tasks; +global using Beef.Demo.Common.Entities; +global using RefDataNamespace = Beef.Demo.Common.Entities; \ 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 d6e6ea1a6..133ca5159 100644 --- a/samples/My.Hr/My.Hr.Common/Agents/Generated/EmployeeAgent.cs +++ b/samples/My.Hr/My.Hr.Common/Agents/Generated/EmployeeAgent.cs @@ -2,58 +2,46 @@ * This file is automatically generated; any changes will be lost. */ -using System; -using System.Collections.Generic; -using System.Net.Http; -using System.Threading; -using System.Threading.Tasks; -using CoreEx.Entities; -using CoreEx.Http; -using CoreEx.Json; -using My.Hr.Common.Entities; -using RefDataNamespace = My.Hr.Common.Entities; - -namespace My.Hr.Common.Agents +namespace My.Hr.Common.Agents; + +/// +/// Provides the HTTP agent. +/// +public partial class EmployeeAgent : TypedHttpClientBase, IEmployeeAgent { /// - /// Provides the HTTP agent. + /// Initializes a new instance of the class. /// - public partial class EmployeeAgent : TypedHttpClientBase, 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); - - /// - public Task> CreateAsync(Employee value, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) - => PostAsync("employees", value, requestOptions: 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); - - /// - 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); - - /// - 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); - - /// - 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); - - /// - 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); - } + /// 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); + + /// + public Task> CreateAsync(Employee value, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) + => PostAsync("employees", value, requestOptions: 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); + + /// + 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); + + /// + 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); + + /// + 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); + + /// + 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); } \ No newline at end of file diff --git a/samples/My.Hr/My.Hr.Common/Agents/Generated/IEmployeeAgent.cs b/samples/My.Hr/My.Hr.Common/Agents/Generated/IEmployeeAgent.cs index 5a16b3559..91be2dced 100644 --- a/samples/My.Hr/My.Hr.Common/Agents/Generated/IEmployeeAgent.cs +++ b/samples/My.Hr/My.Hr.Common/Agents/Generated/IEmployeeAgent.cs @@ -2,92 +2,78 @@ * This file is automatically generated; any changes will be lost. */ -using System; -using System.Collections.Generic; -using System.Net.Http; -using System.Threading; -using System.Threading.Tasks; -using CoreEx.Configuration; -using CoreEx.Entities; -using CoreEx.Http; -using CoreEx.Json; -using Microsoft.Extensions.Logging; -using My.Hr.Common.Entities; -using RefDataNamespace = My.Hr.Common.Entities; +namespace My.Hr.Common.Agents; -namespace My.Hr.Common.Agents +/// +/// Defines the HTTP agent. +/// +public partial interface IEmployeeAgent { /// - /// Defines the HTTP agent. + /// Gets the specified . /// - public partial interface IEmployeeAgent - { - /// - /// Gets the specified . - /// - /// The identifier. - /// The optional . - /// The . - /// A . - Task> GetAsync(Guid id, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); + /// The identifier. + /// The optional . + /// The . + /// A . + Task> GetAsync(Guid id, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); - /// - /// Creates a new . - /// - /// The . - /// The optional . - /// The . - /// A . - Task> CreateAsync(Employee value, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); + /// + /// Creates a new . + /// + /// The . + /// The optional . + /// The . + /// A . + Task> CreateAsync(Employee value, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); - /// - /// Updates an existing . - /// - /// The . - /// The identifier. - /// The optional . - /// The . - /// A . - Task> UpdateAsync(Employee value, Guid id, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); + /// + /// Updates an existing . + /// + /// The . + /// The identifier. + /// The optional . + /// The . + /// A . + Task> UpdateAsync(Employee value, Guid id, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); - /// - /// Patches an existing . - /// - /// The . - /// The that contains the patch content for the . - /// The identifier. - /// The optional . - /// The . - /// A . - Task> PatchAsync(HttpPatchOption patchOption, string value, Guid id, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); + /// + /// Patches an existing . + /// + /// The . + /// The that contains the patch content for the . + /// The identifier. + /// The optional . + /// The . + /// A . + Task> PatchAsync(HttpPatchOption patchOption, string value, Guid id, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); - /// - /// Deletes the specified . - /// - /// The identifier. - /// The optional . - /// The . - /// A . - Task DeleteAsync(Guid id, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); + /// + /// Deletes the specified . + /// + /// The identifier. + /// The optional . + /// The . + /// A . + Task DeleteAsync(Guid id, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); - /// - /// Gets the that contains the items that match the selection criteria. - /// - /// The Args (see ). - /// The . - /// The optional . - /// The . - /// A . - Task> GetByArgsAsync(EmployeeArgs? args, PagingArgs? paging = null, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); + /// + /// Gets the that contains the items that match the selection criteria. + /// + /// The Args (see ). + /// The . + /// The optional . + /// The . + /// A . + Task> GetByArgsAsync(EmployeeArgs? args, PagingArgs? paging = null, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); - /// - /// Terminates an existing . - /// - /// The . - /// The identifier. - /// The optional . - /// The . - /// A . - Task> TerminateAsync(TerminationDetail value, Guid id, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); - } + /// + /// Terminates an existing . + /// + /// The . + /// The identifier. + /// The optional . + /// The . + /// A . + Task> TerminateAsync(TerminationDetail value, Guid id, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); } \ No newline at end of file diff --git a/samples/My.Hr/My.Hr.Common/Agents/Generated/IPerformanceReviewAgent.cs b/samples/My.Hr/My.Hr.Common/Agents/Generated/IPerformanceReviewAgent.cs index a8adacc02..8b80f981a 100644 --- a/samples/My.Hr/My.Hr.Common/Agents/Generated/IPerformanceReviewAgent.cs +++ b/samples/My.Hr/My.Hr.Common/Agents/Generated/IPerformanceReviewAgent.cs @@ -2,83 +2,69 @@ * This file is automatically generated; any changes will be lost. */ -using System; -using System.Collections.Generic; -using System.Net.Http; -using System.Threading; -using System.Threading.Tasks; -using CoreEx.Configuration; -using CoreEx.Entities; -using CoreEx.Http; -using CoreEx.Json; -using Microsoft.Extensions.Logging; -using My.Hr.Common.Entities; -using RefDataNamespace = My.Hr.Common.Entities; +namespace My.Hr.Common.Agents; -namespace My.Hr.Common.Agents +/// +/// Defines the HTTP agent. +/// +public partial interface IPerformanceReviewAgent { /// - /// Defines the HTTP agent. + /// Gets the specified . /// - public partial interface IPerformanceReviewAgent - { - /// - /// Gets the specified . - /// - /// The identifier. - /// The optional . - /// The . - /// A . - Task> GetAsync(Guid id, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); + /// The identifier. + /// The optional . + /// The . + /// A . + Task> GetAsync(Guid id, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); - /// - /// Gets the that contains the items that match the selection criteria. - /// - /// The . - /// The . - /// The optional . - /// The . - /// A . - Task> GetByEmployeeIdAsync(Guid employeeId, PagingArgs? paging = null, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); + /// + /// Gets the that contains the items that match the selection criteria. + /// + /// The . + /// The . + /// The optional . + /// The . + /// A . + Task> GetByEmployeeIdAsync(Guid employeeId, PagingArgs? paging = null, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); - /// - /// Creates a new . - /// - /// The . - /// The . - /// The optional . - /// The . - /// A . - Task> CreateAsync(PerformanceReview value, Guid employeeId, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); + /// + /// Creates a new . + /// + /// The . + /// The . + /// The optional . + /// The . + /// A . + Task> CreateAsync(PerformanceReview value, Guid employeeId, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); - /// - /// Updates an existing . - /// - /// The . - /// The identifier. - /// The optional . - /// The . - /// A . - Task> UpdateAsync(PerformanceReview value, Guid id, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); + /// + /// Updates an existing . + /// + /// The . + /// The identifier. + /// The optional . + /// The . + /// A . + Task> UpdateAsync(PerformanceReview value, Guid id, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); - /// - /// Patches an existing . - /// - /// The . - /// The that contains the patch content for the . - /// The identifier. - /// The optional . - /// The . - /// A . - Task> PatchAsync(HttpPatchOption patchOption, string value, Guid id, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); + /// + /// Patches an existing . + /// + /// The . + /// The that contains the patch content for the . + /// The identifier. + /// The optional . + /// The . + /// A . + Task> PatchAsync(HttpPatchOption patchOption, string value, Guid id, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); - /// - /// Deletes the specified . - /// - /// The identifier. - /// The optional . - /// The . - /// A . - Task DeleteAsync(Guid id, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); - } + /// + /// Deletes the specified . + /// + /// The identifier. + /// The optional . + /// The . + /// A . + Task DeleteAsync(Guid id, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); } \ No newline at end of file diff --git a/samples/My.Hr/My.Hr.Common/Agents/Generated/IReferenceDataAgent.cs b/samples/My.Hr/My.Hr.Common/Agents/Generated/IReferenceDataAgent.cs index a20f6c9a9..c02b00232 100644 --- a/samples/My.Hr/My.Hr.Common/Agents/Generated/IReferenceDataAgent.cs +++ b/samples/My.Hr/My.Hr.Common/Agents/Generated/IReferenceDataAgent.cs @@ -2,80 +2,65 @@ * This file is automatically generated; any changes will be lost. */ -using System; -using System.Collections.Generic; -using System.Net.Http; -using System.Threading; -using System.Threading.Tasks; -using CoreEx.Configuration; -using CoreEx.Entities; -using CoreEx.Http; -using CoreEx.Json; -using CoreEx.RefData; -using Microsoft.Extensions.Logging; -using My.Hr.Common.Entities; -using RefDataNamespace = My.Hr.Common.Entities; +namespace My.Hr.Common.Agents; -namespace My.Hr.Common.Agents +/// +/// Defines the ReferenceData HTTP agent. +/// +public partial interface IReferenceDataAgent { /// - /// Defines the ReferenceData HTTP agent. + /// Gets all of the items that match the filter arguments. /// - public partial interface IReferenceDataAgent - { - /// - /// Gets all of the items that match the filter arguments. - /// - /// The optional arguments. - /// The optional . - /// The . - /// A . - Task> GenderGetAllAsync(ReferenceDataFilter? args = null, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); + /// The optional arguments. + /// The optional . + /// The . + /// A . + Task> GenderGetAllAsync(ReferenceDataFilter? args = null, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); - /// - /// Gets all of the items that match the filter arguments. - /// - /// The optional arguments. - /// The optional . - /// The . - /// A . - Task> TerminationReasonGetAllAsync(ReferenceDataFilter? args = null, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); + /// + /// Gets all of the items that match the filter arguments. + /// + /// The optional arguments. + /// The optional . + /// The . + /// A . + Task> TerminationReasonGetAllAsync(ReferenceDataFilter? args = null, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); - /// - /// Gets all of the items that match the filter arguments. - /// - /// The optional arguments. - /// The optional . - /// The . - /// A . - Task> RelationshipTypeGetAllAsync(ReferenceDataFilter? args = null, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); + /// + /// Gets all of the items that match the filter arguments. + /// + /// The optional arguments. + /// The optional . + /// The . + /// A . + Task> RelationshipTypeGetAllAsync(ReferenceDataFilter? args = null, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); - /// - /// Gets all of the items that match the filter arguments. - /// - /// The optional arguments. - /// The optional . - /// The . - /// A . - Task> USStateGetAllAsync(ReferenceDataFilter? args = null, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); + /// + /// Gets all of the items that match the filter arguments. + /// + /// The optional arguments. + /// The optional . + /// The . + /// A . + Task> USStateGetAllAsync(ReferenceDataFilter? args = null, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); - /// - /// Gets all of the items that match the filter arguments. - /// - /// The optional arguments. - /// The optional . - /// The . - /// A . - Task> PerformanceOutcomeGetAllAsync(ReferenceDataFilter? args = null, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); + /// + /// Gets all of the items that match the filter arguments. + /// + /// The optional arguments. + /// The optional . + /// The . + /// A . + Task> PerformanceOutcomeGetAllAsync(ReferenceDataFilter? args = null, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); - /// - /// Gets the reference data entries for the specified entities and codes from the query string; e.g: ref?entity=codeX,codeY&entity2=codeZ&entity3 - /// - /// The optional list of reference data names. - /// The optional . - /// The . - /// A . - /// The reference data objects will need to be manually extracted from the corresponding response content. - Task GetNamedAsync(string[] names, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); - } + /// + /// Gets the reference data entries for the specified entities and codes from the query string; e.g: ref?entity=codeX,codeY&entity2=codeZ&entity3 + /// + /// The optional list of reference data names. + /// The optional . + /// The . + /// A . + /// The reference data objects will need to be manually extracted from the corresponding response content. + Task GetNamedAsync(string[] names, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); } \ 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 30a6de7c8..c73fd1400 100644 --- a/samples/My.Hr/My.Hr.Common/Agents/Generated/PerformanceReviewAgent.cs +++ b/samples/My.Hr/My.Hr.Common/Agents/Generated/PerformanceReviewAgent.cs @@ -2,54 +2,42 @@ * This file is automatically generated; any changes will be lost. */ -using System; -using System.Collections.Generic; -using System.Net.Http; -using System.Threading; -using System.Threading.Tasks; -using CoreEx.Entities; -using CoreEx.Http; -using CoreEx.Json; -using My.Hr.Common.Entities; -using RefDataNamespace = My.Hr.Common.Entities; - -namespace My.Hr.Common.Agents +namespace My.Hr.Common.Agents; + +/// +/// Provides the HTTP agent. +/// +public partial class PerformanceReviewAgent : TypedHttpClientBase, IPerformanceReviewAgent { /// - /// Provides the HTTP agent. + /// Initializes a new instance of the class. /// - public partial class PerformanceReviewAgent : TypedHttpClientBase, 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); - - /// - 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); - - /// - 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); - - /// - 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); - - /// - 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); - - /// - 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); - } + /// 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); + + /// + 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); + + /// + 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); + + /// + 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); + + /// + 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); + + /// + 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); } \ 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 505b4f5f1..cfb7173b0 100644 --- a/samples/My.Hr/My.Hr.Common/Agents/Generated/ReferenceDataAgent.cs +++ b/samples/My.Hr/My.Hr.Common/Agents/Generated/ReferenceDataAgent.cs @@ -2,61 +2,48 @@ * This file is automatically generated; any changes will be lost. */ -using System; -using System.Collections.Generic; -using System.Net.Http; -using System.Threading; -using System.Threading.Tasks; -using CoreEx.Entities; -using CoreEx.Http; -using CoreEx.Json; -using CoreEx.RefData; -using My.Hr.Common.Entities; -using RefDataNamespace = My.Hr.Common.Entities; - -namespace My.Hr.Common.Agents +namespace My.Hr.Common.Agents; + +/// +/// Provides the ReferenceData HTTP agent. +/// +public partial class ReferenceDataAgent : TypedHttpClientBase, IReferenceDataAgent { /// - /// Provides the ReferenceData HTTP agent. + /// Initializes a new instance of the class. /// - public partial class ReferenceDataAgent : TypedHttpClientBase, IReferenceDataAgent + /// 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); + + /// + 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); + + /// + 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); + + /// + 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); + + /// + 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); + + /// + public Task GetNamedAsync(string[] names, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) { - /// - /// 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); - - /// - 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); - - /// - 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); - - /// - 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); - - /// - 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); - - /// - public Task GetNamedAsync(string[] names, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) - { - var ro = requestOptions ?? new HttpRequestOptions(); - if (names != null) - ro.UrlQueryString += string.Join("&", names); - - return GetAsync("ref", ro, null, cancellationToken); - } + var ro = requestOptions ?? new HttpRequestOptions(); + if (names != null) + ro.UrlQueryString += string.Join("&", names); + + return GetAsync("ref", ro, null, cancellationToken); } } \ No newline at end of file diff --git a/samples/My.Hr/My.Hr.Common/Entities/Generated/Address.cs b/samples/My.Hr/My.Hr.Common/Entities/Generated/Address.cs index dff848ba6..3eef386fb 100644 --- a/samples/My.Hr/My.Hr.Common/Entities/Generated/Address.cs +++ b/samples/My.Hr/My.Hr.Common/Entities/Generated/Address.cs @@ -2,47 +2,40 @@ * This file is automatically generated; any changes will be lost. */ -using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Text.Json.Serialization; -using CoreEx.Entities; +namespace My.Hr.Common.Entities; -namespace My.Hr.Common.Entities +/// +/// Represents the Address entity. +/// +public partial class Address { /// - /// Represents the Address entity. + /// Gets or sets the Street1. /// - public partial class Address - { - /// - /// Gets or sets the Street1. - /// - public string? Street1 { get; set; } + public string? Street1 { get; set; } - /// - /// Gets or sets the Street2. - /// - public string? Street2 { get; set; } + /// + /// Gets or sets the Street2. + /// + public string? Street2 { get; set; } - /// - /// Gets or sets the City. - /// - public string? City { get; set; } + /// + /// Gets or sets the City. + /// + public string? City { get; set; } - /// - /// Gets the corresponding State text (read-only where selected). - /// - public string? StateText { get; set; } + /// + /// Gets the corresponding State text (read-only where selected). + /// + public string? StateText { get; set; } - /// - /// Gets or sets the State code. - /// - public string? State { get; set; } + /// + /// Gets or sets the State code. + /// + public string? State { get; set; } - /// - /// Gets or sets the Post Code. - /// - public string? PostCode { get; set; } - } -} \ No newline at end of file + /// + /// Gets or sets the Post Code. + /// + public string? PostCode { get; set; } +} diff --git a/samples/My.Hr/My.Hr.Common/Entities/Generated/EmergencyContact.cs b/samples/My.Hr/My.Hr.Common/Entities/Generated/EmergencyContact.cs index 65469dfa0..aad5561ca 100644 --- a/samples/My.Hr/My.Hr.Common/Entities/Generated/EmergencyContact.cs +++ b/samples/My.Hr/My.Hr.Common/Entities/Generated/EmergencyContact.cs @@ -2,52 +2,45 @@ * This file is automatically generated; any changes will be lost. */ -using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Text.Json.Serialization; -using CoreEx.Entities; +namespace My.Hr.Common.Entities; -namespace My.Hr.Common.Entities +/// +/// Represents the Emergency Contact entity. +/// +public partial class EmergencyContact : IIdentifier { /// - /// Represents the Emergency Contact entity. + /// Gets or sets the identifier. /// - public partial class EmergencyContact : IIdentifier - { - /// - /// Gets or sets the identifier. - /// - public Guid Id { get; set; } - - /// - /// Gets or sets the First Name. - /// - public string? FirstName { get; set; } - - /// - /// Gets or sets the Last Name. - /// - public string? LastName { get; set; } - - /// - /// Gets or sets the Phone No. - /// - public string? PhoneNo { get; set; } - - /// - /// Gets the corresponding Relationship text (read-only where selected). - /// - public string? RelationshipText { get; set; } - - /// - /// Gets or sets the Relationship code. - /// - public string? Relationship { get; set; } - } + public Guid Id { get; set; } /// - /// Represents the EmergencyContact collection. + /// Gets or sets the First Name. /// - public partial class EmergencyContactCollection : List { } -} \ No newline at end of file + public string? FirstName { get; set; } + + /// + /// Gets or sets the Last Name. + /// + public string? LastName { get; set; } + + /// + /// Gets or sets the Phone No. + /// + public string? PhoneNo { get; set; } + + /// + /// Gets the corresponding Relationship text (read-only where selected). + /// + public string? RelationshipText { get; set; } + + /// + /// Gets or sets the Relationship code. + /// + public string? Relationship { get; set; } +} + +/// +/// Represents the EmergencyContact collection. +/// +public partial class EmergencyContactCollection : List { } diff --git a/samples/My.Hr/My.Hr.Common/Entities/Generated/Employee.cs b/samples/My.Hr/My.Hr.Common/Entities/Generated/Employee.cs index c3e56cb56..8a75c1235 100644 --- a/samples/My.Hr/My.Hr.Common/Entities/Generated/Employee.cs +++ b/samples/My.Hr/My.Hr.Common/Entities/Generated/Employee.cs @@ -2,38 +2,31 @@ * This file is automatically generated; any changes will be lost. */ -using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Text.Json.Serialization; -using CoreEx.Entities; +namespace My.Hr.Common.Entities; -namespace My.Hr.Common.Entities +/// +/// Represents the Employee entity. +/// +public partial class Employee : EmployeeBase, IETag, IChangeLog { /// - /// Represents the Employee entity. + /// Gets or sets the Address. /// - public partial class Employee : EmployeeBase, IETag, IChangeLog - { - /// - /// Gets or sets the Address. - /// - public Address? Address { get; set; } + public Address? Address { get; set; } - /// - /// Gets or sets the Emergency Contacts. - /// - public EmergencyContactCollection? EmergencyContacts { get; set; } + /// + /// Gets or sets the Emergency Contacts. + /// + public EmergencyContactCollection? EmergencyContacts { get; set; } - /// - /// Gets or sets the ETag. - /// - [JsonPropertyName("etag")] - public string? ETag { get; set; } + /// + /// Gets or sets the ETag. + /// + [JsonPropertyName("etag")] + public string? ETag { get; set; } - /// - /// Gets or sets the Change Log. - /// - public ChangeLog? ChangeLog { get; set; } - } -} \ No newline at end of file + /// + /// Gets or sets the Change Log. + /// + public ChangeLog? ChangeLog { get; set; } +} diff --git a/samples/My.Hr/My.Hr.Common/Entities/Generated/EmployeeArgs.cs b/samples/My.Hr/My.Hr.Common/Entities/Generated/EmployeeArgs.cs index 63ba17012..d9a489a21 100644 --- a/samples/My.Hr/My.Hr.Common/Entities/Generated/EmployeeArgs.cs +++ b/samples/My.Hr/My.Hr.Common/Entities/Generated/EmployeeArgs.cs @@ -2,48 +2,41 @@ * This file is automatically generated; any changes will be lost. */ -using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Text.Json.Serialization; -using CoreEx.Entities; +namespace My.Hr.Common.Entities; -namespace My.Hr.Common.Entities +/// +/// Represents the Employee search arguments entity. +/// +public partial class EmployeeArgs { /// - /// Represents the Employee search arguments entity. + /// Gets or sets the First Name. /// - public partial class EmployeeArgs - { - /// - /// Gets or sets the First Name. - /// - public string? FirstName { get; set; } + public string? FirstName { get; set; } - /// - /// Gets or sets the Last Name. - /// - public string? LastName { get; set; } + /// + /// Gets or sets the Last Name. + /// + public string? LastName { get; set; } - /// - /// Gets or sets the Genders code(s). - /// - public List? Genders { get; set; } + /// + /// Gets or sets the Genders code(s). + /// + public List? Genders { get; set; } - /// - /// Gets or sets the Start From. - /// - public DateTime? StartFrom { get; set; } + /// + /// Gets or sets the Start From. + /// + public DateTime? StartFrom { get; set; } - /// - /// Gets or sets the Start To. - /// - public DateTime? StartTo { get; set; } + /// + /// Gets or sets the Start To. + /// + public DateTime? StartTo { get; set; } - /// - /// Indicates whether Is Include Terminated. - /// - [JsonPropertyName("includeTerminated")] - public bool? IsIncludeTerminated { get; set; } - } -} \ No newline at end of file + /// + /// Indicates whether Is Include Terminated. + /// + [JsonPropertyName("includeTerminated")] + public bool? IsIncludeTerminated { get; set; } +} diff --git a/samples/My.Hr/My.Hr.Common/Entities/Generated/EmployeeBase.cs b/samples/My.Hr/My.Hr.Common/Entities/Generated/EmployeeBase.cs index 3ff8df7b6..a3d18f25d 100644 --- a/samples/My.Hr/My.Hr.Common/Entities/Generated/EmployeeBase.cs +++ b/samples/My.Hr/My.Hr.Common/Entities/Generated/EmployeeBase.cs @@ -2,96 +2,89 @@ * This file is automatically generated; any changes will be lost. */ -using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Text.Json.Serialization; -using CoreEx.Entities; +namespace My.Hr.Common.Entities; -namespace My.Hr.Common.Entities +/// +/// Represents the Employee base entity. +/// +public partial class EmployeeBase : IIdentifier { /// - /// Represents the Employee base entity. + /// Gets or sets the Employee identifier. /// - public partial class EmployeeBase : IIdentifier - { - /// - /// Gets or sets the Employee identifier. - /// - public Guid Id { get; set; } + public Guid Id { get; set; } - /// - /// Gets or sets the Unique Employee Email. - /// - public string? Email { get; set; } - - /// - /// Gets or sets the First Name. - /// - public string? FirstName { get; set; } + /// + /// Gets or sets the Unique Employee Email. + /// + public string? Email { get; set; } - /// - /// Gets or sets the Last Name. - /// - public string? LastName { get; set; } + /// + /// Gets or sets the First Name. + /// + public string? FirstName { get; set; } - /// - /// Gets the corresponding Gender text (read-only where selected). - /// - public string? GenderText { get; set; } + /// + /// Gets or sets the Last Name. + /// + public string? LastName { get; set; } - /// - /// Gets or sets the Gender code. - /// - public string? Gender { get; set; } + /// + /// Gets the corresponding Gender text (read-only where selected). + /// + public string? GenderText { get; set; } - /// - /// Gets or sets the Birthday. - /// - public DateTime Birthday { get; set; } + /// + /// Gets or sets the Gender code. + /// + public string? Gender { get; set; } - /// - /// Gets or sets the Start Date. - /// - public DateTime StartDate { get; set; } + /// + /// Gets or sets the Birthday. + /// + public DateTime Birthday { get; set; } - /// - /// Gets or sets the Termination. - /// - public TerminationDetail? Termination { get; set; } + /// + /// Gets or sets the Start Date. + /// + public DateTime StartDate { get; set; } - /// - /// Gets or sets the Phone No. - /// - public string? PhoneNo { get; set; } - } + /// + /// Gets or sets the Termination. + /// + public TerminationDetail? Termination { get; set; } /// - /// Represents the EmployeeBase collection. + /// Gets or sets the Phone No. /// - public partial class EmployeeBaseCollection : List { } + public string? PhoneNo { get; set; } +} + +/// +/// Represents the EmployeeBase collection. +/// +public partial class EmployeeBaseCollection : List { } +/// +/// Represents the EmployeeBase collection result. +/// +public class EmployeeBaseCollectionResult : CollectionResult +{ + /// + /// Initializes a new instance of the class. + /// + public EmployeeBaseCollectionResult() { } + + /// + /// Initializes a new instance of the class with . + /// + /// The . + public EmployeeBaseCollectionResult(PagingArgs? paging) : base(paging) { } + /// - /// Represents the EmployeeBase collection result. + /// Initializes a new instance of the class with to add. /// - public class EmployeeBaseCollectionResult : CollectionResult - { - /// - /// Initializes a new instance of the class. - /// - public EmployeeBaseCollectionResult() { } - - /// - /// Initializes a new instance of the class with . - /// - /// The . - public EmployeeBaseCollectionResult(PagingArgs? paging) : base(paging) { } - - /// - /// Initializes a new instance of the class with to add. - /// - /// The items to add. - /// The . - public EmployeeBaseCollectionResult(IEnumerable items, PagingArgs? paging = null) : base(paging) => Items.AddRange(items); - } -} \ No newline at end of file + /// The items to add. + /// The . + public EmployeeBaseCollectionResult(IEnumerable items, PagingArgs? paging = null) : base(paging) => Items.AddRange(items); +} diff --git a/samples/My.Hr/My.Hr.Common/Entities/Generated/Gender.cs b/samples/My.Hr/My.Hr.Common/Entities/Generated/Gender.cs index 5bd562787..786e1267b 100644 --- a/samples/My.Hr/My.Hr.Common/Entities/Generated/Gender.cs +++ b/samples/My.Hr/My.Hr.Common/Entities/Generated/Gender.cs @@ -2,22 +2,14 @@ * This file is automatically generated; any changes will be lost. */ -using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Text.Json.Serialization; -using CoreEx.Entities; -using CoreEx.RefData; +namespace My.Hr.Common.Entities; -namespace My.Hr.Common.Entities -{ - /// - /// Represents the Gender entity. - /// - public partial class Gender : ReferenceDataBase { } +/// +/// Represents the Gender entity. +/// +public partial class Gender : ReferenceDataBase { } - /// - /// Represents the Gender collection. - /// - public partial class GenderCollection : List { } -} \ No newline at end of file +/// +/// Represents the Gender collection. +/// +public partial class GenderCollection : List { } diff --git a/samples/My.Hr/My.Hr.Common/Entities/Generated/PerformanceOutcome.cs b/samples/My.Hr/My.Hr.Common/Entities/Generated/PerformanceOutcome.cs index e1c1261d4..f7760e6cb 100644 --- a/samples/My.Hr/My.Hr.Common/Entities/Generated/PerformanceOutcome.cs +++ b/samples/My.Hr/My.Hr.Common/Entities/Generated/PerformanceOutcome.cs @@ -2,22 +2,14 @@ * This file is automatically generated; any changes will be lost. */ -using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Text.Json.Serialization; -using CoreEx.Entities; -using CoreEx.RefData; +namespace My.Hr.Common.Entities; -namespace My.Hr.Common.Entities -{ - /// - /// Represents the Performance Outcome entity. - /// - public partial class PerformanceOutcome : ReferenceDataBase { } +/// +/// Represents the Performance Outcome entity. +/// +public partial class PerformanceOutcome : ReferenceDataBase { } - /// - /// Represents the PerformanceOutcome collection. - /// - public partial class PerformanceOutcomeCollection : List { } -} \ No newline at end of file +/// +/// Represents the PerformanceOutcome collection. +/// +public partial class PerformanceOutcomeCollection : List { } diff --git a/samples/My.Hr/My.Hr.Common/Entities/Generated/PerformanceReview.cs b/samples/My.Hr/My.Hr.Common/Entities/Generated/PerformanceReview.cs index 77615746b..825047e10 100644 --- a/samples/My.Hr/My.Hr.Common/Entities/Generated/PerformanceReview.cs +++ b/samples/My.Hr/My.Hr.Common/Entities/Generated/PerformanceReview.cs @@ -2,92 +2,85 @@ * This file is automatically generated; any changes will be lost. */ -using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Text.Json.Serialization; -using CoreEx.Entities; +namespace My.Hr.Common.Entities; -namespace My.Hr.Common.Entities +/// +/// Represents the Performance Review entity. +/// +public partial class PerformanceReview : IIdentifier, IETag, IChangeLog { /// - /// Represents the Performance Review entity. + /// Gets or sets the Employee identifier. /// - public partial class PerformanceReview : IIdentifier, IETag, IChangeLog - { - /// - /// Gets or sets the Employee identifier. - /// - public Guid Id { get; set; } + public Guid Id { get; set; } - /// - /// Gets or sets the Employee.Id (value is immutable). - /// - public Guid EmployeeId { get; set; } - - /// - /// Gets or sets the Date. - /// - public DateTime Date { get; set; } + /// + /// Gets or sets the Employee.Id (value is immutable). + /// + public Guid EmployeeId { get; set; } - /// - /// Gets the corresponding Outcome text (read-only where selected). - /// - public string? OutcomeText { get; set; } + /// + /// Gets or sets the Date. + /// + public DateTime Date { get; set; } - /// - /// Gets or sets the Outcome code. - /// - public string? Outcome { get; set; } + /// + /// Gets the corresponding Outcome text (read-only where selected). + /// + public string? OutcomeText { get; set; } - /// - /// Gets or sets the Reviewer. - /// - public string? Reviewer { get; set; } + /// + /// Gets or sets the Outcome code. + /// + public string? Outcome { get; set; } - /// - /// Gets or sets the Notes. - /// - public string? Notes { get; set; } + /// + /// Gets or sets the Reviewer. + /// + public string? Reviewer { get; set; } - /// - /// Gets or sets the ETag. - /// - [JsonPropertyName("etag")] - public string? ETag { get; set; } + /// + /// Gets or sets the Notes. + /// + public string? Notes { get; set; } - /// - /// Gets or sets the Change Log. - /// - public ChangeLog? ChangeLog { get; set; } - } + /// + /// Gets or sets the ETag. + /// + [JsonPropertyName("etag")] + public string? ETag { get; set; } /// - /// Represents the PerformanceReview collection. + /// Gets or sets the Change Log. /// - public partial class PerformanceReviewCollection : List { } + public ChangeLog? ChangeLog { get; set; } +} + +/// +/// Represents the PerformanceReview collection. +/// +public partial class PerformanceReviewCollection : List { } +/// +/// Represents the PerformanceReview collection result. +/// +public class PerformanceReviewCollectionResult : CollectionResult +{ + /// + /// Initializes a new instance of the class. + /// + public PerformanceReviewCollectionResult() { } + + /// + /// Initializes a new instance of the class with . + /// + /// The . + public PerformanceReviewCollectionResult(PagingArgs? paging) : base(paging) { } + /// - /// Represents the PerformanceReview collection result. + /// Initializes a new instance of the class with to add. /// - public class PerformanceReviewCollectionResult : CollectionResult - { - /// - /// Initializes a new instance of the class. - /// - public PerformanceReviewCollectionResult() { } - - /// - /// Initializes a new instance of the class with . - /// - /// The . - public PerformanceReviewCollectionResult(PagingArgs? paging) : base(paging) { } - - /// - /// Initializes a new instance of the class with to add. - /// - /// The items to add. - /// The . - public PerformanceReviewCollectionResult(IEnumerable items, PagingArgs? paging = null) : base(paging) => Items.AddRange(items); - } -} \ No newline at end of file + /// The items to add. + /// The . + public PerformanceReviewCollectionResult(IEnumerable items, PagingArgs? paging = null) : base(paging) => Items.AddRange(items); +} diff --git a/samples/My.Hr/My.Hr.Common/Entities/Generated/RelationshipType.cs b/samples/My.Hr/My.Hr.Common/Entities/Generated/RelationshipType.cs index 266d0a04d..7209a932c 100644 --- a/samples/My.Hr/My.Hr.Common/Entities/Generated/RelationshipType.cs +++ b/samples/My.Hr/My.Hr.Common/Entities/Generated/RelationshipType.cs @@ -2,22 +2,14 @@ * This file is automatically generated; any changes will be lost. */ -using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Text.Json.Serialization; -using CoreEx.Entities; -using CoreEx.RefData; +namespace My.Hr.Common.Entities; -namespace My.Hr.Common.Entities -{ - /// - /// Represents the Relationship Type entity. - /// - public partial class RelationshipType : ReferenceDataBase { } +/// +/// Represents the Relationship Type entity. +/// +public partial class RelationshipType : ReferenceDataBase { } - /// - /// Represents the RelationshipType collection. - /// - public partial class RelationshipTypeCollection : List { } -} \ No newline at end of file +/// +/// Represents the RelationshipType collection. +/// +public partial class RelationshipTypeCollection : List { } diff --git a/samples/My.Hr/My.Hr.Common/Entities/Generated/TerminationDetail.cs b/samples/My.Hr/My.Hr.Common/Entities/Generated/TerminationDetail.cs index 76c13b4be..f5a08fc3d 100644 --- a/samples/My.Hr/My.Hr.Common/Entities/Generated/TerminationDetail.cs +++ b/samples/My.Hr/My.Hr.Common/Entities/Generated/TerminationDetail.cs @@ -2,32 +2,25 @@ * This file is automatically generated; any changes will be lost. */ -using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Text.Json.Serialization; -using CoreEx.Entities; +namespace My.Hr.Common.Entities; -namespace My.Hr.Common.Entities +/// +/// Represents the Termination Detail entity. +/// +public partial class TerminationDetail { /// - /// Represents the Termination Detail entity. + /// Gets or sets the Date. /// - public partial class TerminationDetail - { - /// - /// Gets or sets the Date. - /// - public DateTime Date { get; set; } + public DateTime Date { get; set; } - /// - /// Gets the corresponding Reason text (read-only where selected). - /// - public string? ReasonText { get; set; } + /// + /// Gets the corresponding Reason text (read-only where selected). + /// + public string? ReasonText { get; set; } - /// - /// Gets or sets the Reason code. - /// - public string? Reason { get; set; } - } -} \ No newline at end of file + /// + /// Gets or sets the Reason code. + /// + public string? Reason { get; set; } +} diff --git a/samples/My.Hr/My.Hr.Common/Entities/Generated/TerminationReason.cs b/samples/My.Hr/My.Hr.Common/Entities/Generated/TerminationReason.cs index ab0740cff..e12ece146 100644 --- a/samples/My.Hr/My.Hr.Common/Entities/Generated/TerminationReason.cs +++ b/samples/My.Hr/My.Hr.Common/Entities/Generated/TerminationReason.cs @@ -2,22 +2,14 @@ * This file is automatically generated; any changes will be lost. */ -using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Text.Json.Serialization; -using CoreEx.Entities; -using CoreEx.RefData; +namespace My.Hr.Common.Entities; -namespace My.Hr.Common.Entities -{ - /// - /// Represents the Termination Reason entity. - /// - public partial class TerminationReason : ReferenceDataBase { } +/// +/// Represents the Termination Reason entity. +/// +public partial class TerminationReason : ReferenceDataBase { } - /// - /// Represents the TerminationReason collection. - /// - public partial class TerminationReasonCollection : List { } -} \ No newline at end of file +/// +/// Represents the TerminationReason collection. +/// +public partial class TerminationReasonCollection : List { } diff --git a/samples/My.Hr/My.Hr.Common/Entities/Generated/USState.cs b/samples/My.Hr/My.Hr.Common/Entities/Generated/USState.cs index 81d827b89..eba3e7528 100644 --- a/samples/My.Hr/My.Hr.Common/Entities/Generated/USState.cs +++ b/samples/My.Hr/My.Hr.Common/Entities/Generated/USState.cs @@ -2,22 +2,14 @@ * This file is automatically generated; any changes will be lost. */ -using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Text.Json.Serialization; -using CoreEx.Entities; -using CoreEx.RefData; +namespace My.Hr.Common.Entities; -namespace My.Hr.Common.Entities -{ - /// - /// Represents the US State entity. - /// - public partial class USState : ReferenceDataBase { } +/// +/// Represents the US State entity. +/// +public partial class USState : ReferenceDataBase { } - /// - /// Represents the USState collection. - /// - public partial class USStateCollection : List { } -} \ No newline at end of file +/// +/// Represents the USState collection. +/// +public partial class USStateCollection : List { } diff --git a/samples/My.Hr/My.Hr.Common/GlobalUsings.cs b/samples/My.Hr/My.Hr.Common/GlobalUsings.cs new file mode 100644 index 000000000..d26eab543 --- /dev/null +++ b/samples/My.Hr/My.Hr.Common/GlobalUsings.cs @@ -0,0 +1,13 @@ +global using CoreEx.Entities; +global using CoreEx.Http; +global using CoreEx.Json; +global using CoreEx.RefData; +global using System; +global using System.Collections.Generic; +global using System.Diagnostics.CodeAnalysis; +global using System.Text.Json.Serialization; +global using System.Net.Http; +global using System.Threading; +global using System.Threading.Tasks; +global using My.Hr.Common.Entities; +global using RefDataNamespace = My.Hr.Common.Entities; \ No newline at end of file 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 0ec02a326..0122b62e5 100644 --- a/samples/My.Hr/My.Hr.Common/My.Hr.Common.csproj +++ b/samples/My.Hr/My.Hr.Common/My.Hr.Common.csproj @@ -2,6 +2,8 @@ netstandard2.1 enable + Preview + true 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 ffe828c0c..d93200eb9 100644 --- a/samples/MyEf.Hr/MyEf.Hr.Common/Agents/Generated/EmployeeAgent.cs +++ b/samples/MyEf.Hr/MyEf.Hr.Common/Agents/Generated/EmployeeAgent.cs @@ -2,62 +2,50 @@ * This file is automatically generated; any changes will be lost. */ -using System; -using System.Collections.Generic; -using System.Net.Http; -using System.Threading; -using System.Threading.Tasks; -using CoreEx.Entities; -using CoreEx.Http; -using CoreEx.Json; -using MyEf.Hr.Common.Entities; -using RefDataNamespace = MyEf.Hr.Common.Entities; - -namespace MyEf.Hr.Common.Agents +namespace MyEf.Hr.Common.Agents; + +/// +/// Provides the HTTP agent. +/// +public partial class EmployeeAgent : TypedHttpClientBase, IEmployeeAgent { /// - /// Provides the HTTP agent. + /// Initializes a new instance of the class. /// - public partial class EmployeeAgent : TypedHttpClientBase, 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); - - /// - public Task> CreateAsync(Employee value, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) - => PostAsync("employees", value, requestOptions: 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); - - /// - 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); - - /// - 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); - - /// - 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); - - /// - 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); - - /// - 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); - } + /// 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); + + /// + public Task> CreateAsync(Employee value, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) + => PostAsync("employees", value, requestOptions: 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); + + /// + 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); + + /// + 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); + + /// + 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); + + /// + 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); + + /// + 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); } \ No newline at end of file diff --git a/samples/MyEf.Hr/MyEf.Hr.Common/Agents/Generated/IEmployeeAgent.cs b/samples/MyEf.Hr/MyEf.Hr.Common/Agents/Generated/IEmployeeAgent.cs index bf4cd314e..673e780ce 100644 --- a/samples/MyEf.Hr/MyEf.Hr.Common/Agents/Generated/IEmployeeAgent.cs +++ b/samples/MyEf.Hr/MyEf.Hr.Common/Agents/Generated/IEmployeeAgent.cs @@ -2,102 +2,88 @@ * This file is automatically generated; any changes will be lost. */ -using System; -using System.Collections.Generic; -using System.Net.Http; -using System.Threading; -using System.Threading.Tasks; -using CoreEx.Configuration; -using CoreEx.Entities; -using CoreEx.Http; -using CoreEx.Json; -using Microsoft.Extensions.Logging; -using MyEf.Hr.Common.Entities; -using RefDataNamespace = MyEf.Hr.Common.Entities; +namespace MyEf.Hr.Common.Agents; -namespace MyEf.Hr.Common.Agents +/// +/// Defines the HTTP agent. +/// +public partial interface IEmployeeAgent { /// - /// Defines the HTTP agent. + /// Gets the specified . /// - public partial interface IEmployeeAgent - { - /// - /// Gets the specified . - /// - /// The identifier. - /// The optional . - /// The . - /// A . - Task> GetAsync(Guid id, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); + /// The identifier. + /// The optional . + /// The . + /// A . + Task> GetAsync(Guid id, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); - /// - /// Creates a new . - /// - /// The . - /// The optional . - /// The . - /// A . - Task> CreateAsync(Employee value, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); + /// + /// Creates a new . + /// + /// The . + /// The optional . + /// The . + /// A . + Task> CreateAsync(Employee value, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); - /// - /// Updates an existing . - /// - /// The . - /// The identifier. - /// The optional . - /// The . - /// A . - Task> UpdateAsync(Employee value, Guid id, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); + /// + /// Updates an existing . + /// + /// The . + /// The identifier. + /// The optional . + /// The . + /// A . + Task> UpdateAsync(Employee value, Guid id, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); - /// - /// Patches an existing . - /// - /// The . - /// The that contains the patch content for the . - /// The identifier. - /// The optional . - /// The . - /// A . - Task> PatchAsync(HttpPatchOption patchOption, string value, Guid id, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); + /// + /// Patches an existing . + /// + /// The . + /// The that contains the patch content for the . + /// The identifier. + /// The optional . + /// The . + /// A . + Task> PatchAsync(HttpPatchOption patchOption, string value, Guid id, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); - /// - /// Deletes the specified . - /// - /// The identifier. - /// The optional . - /// The . - /// A . - Task DeleteAsync(Guid id, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); + /// + /// Deletes the specified . + /// + /// The identifier. + /// The optional . + /// The . + /// A . + Task DeleteAsync(Guid id, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); - /// - /// Gets the that contains the items that match the selection criteria. - /// - /// The Args (see ). - /// The . - /// The optional . - /// The . - /// A . - Task> GetByArgsAsync(EmployeeArgs? args, PagingArgs? paging = null, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); + /// + /// Gets the that contains the items that match the selection criteria. + /// + /// The Args (see ). + /// The . + /// The optional . + /// The . + /// A . + Task> GetByArgsAsync(EmployeeArgs? args, PagingArgs? paging = null, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); - /// - /// Gets the that contains the items that match the selection criteria. - /// - /// The . - /// The . - /// The optional . - /// The . - /// A . - Task> GetByQueryAsync(QueryArgs? query = null, PagingArgs? paging = null, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); + /// + /// Gets the that contains the items that match the selection criteria. + /// + /// The . + /// The . + /// The optional . + /// The . + /// A . + Task> GetByQueryAsync(QueryArgs? query = null, PagingArgs? paging = null, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); - /// - /// Terminates an existing . - /// - /// The . - /// The identifier. - /// The optional . - /// The . - /// A . - Task> TerminateAsync(TerminationDetail value, Guid id, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); - } + /// + /// Terminates an existing . + /// + /// The . + /// The identifier. + /// The optional . + /// The . + /// A . + Task> TerminateAsync(TerminationDetail value, Guid id, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); } \ No newline at end of file diff --git a/samples/MyEf.Hr/MyEf.Hr.Common/Agents/Generated/IPerformanceReviewAgent.cs b/samples/MyEf.Hr/MyEf.Hr.Common/Agents/Generated/IPerformanceReviewAgent.cs index 21e139f88..a930f97e8 100644 --- a/samples/MyEf.Hr/MyEf.Hr.Common/Agents/Generated/IPerformanceReviewAgent.cs +++ b/samples/MyEf.Hr/MyEf.Hr.Common/Agents/Generated/IPerformanceReviewAgent.cs @@ -2,83 +2,69 @@ * This file is automatically generated; any changes will be lost. */ -using System; -using System.Collections.Generic; -using System.Net.Http; -using System.Threading; -using System.Threading.Tasks; -using CoreEx.Configuration; -using CoreEx.Entities; -using CoreEx.Http; -using CoreEx.Json; -using Microsoft.Extensions.Logging; -using MyEf.Hr.Common.Entities; -using RefDataNamespace = MyEf.Hr.Common.Entities; +namespace MyEf.Hr.Common.Agents; -namespace MyEf.Hr.Common.Agents +/// +/// Defines the HTTP agent. +/// +public partial interface IPerformanceReviewAgent { /// - /// Defines the HTTP agent. + /// Gets the specified . /// - public partial interface IPerformanceReviewAgent - { - /// - /// Gets the specified . - /// - /// The identifier. - /// The optional . - /// The . - /// A . - Task> GetAsync(Guid id, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); + /// The identifier. + /// The optional . + /// The . + /// A . + Task> GetAsync(Guid id, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); - /// - /// Updates an existing . - /// - /// The . - /// The identifier. - /// The optional . - /// The . - /// A . - Task> UpdateAsync(PerformanceReview value, Guid id, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); + /// + /// Updates an existing . + /// + /// The . + /// The identifier. + /// The optional . + /// The . + /// A . + Task> UpdateAsync(PerformanceReview value, Guid id, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); - /// - /// Patches an existing . - /// - /// The . - /// The that contains the patch content for the . - /// The identifier. - /// The optional . - /// The . - /// A . - Task> PatchAsync(HttpPatchOption patchOption, string value, Guid id, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); + /// + /// Patches an existing . + /// + /// The . + /// The that contains the patch content for the . + /// The identifier. + /// The optional . + /// The . + /// A . + Task> PatchAsync(HttpPatchOption patchOption, string value, Guid id, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); - /// - /// Deletes the specified . - /// - /// The identifier. - /// The optional . - /// The . - /// A . - Task DeleteAsync(Guid id, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); + /// + /// Deletes the specified . + /// + /// The identifier. + /// The optional . + /// The . + /// A . + Task DeleteAsync(Guid id, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); - /// - /// Gets the that contains the items that match the selection criteria. - /// - /// The identifier. - /// The . - /// The optional . - /// The . - /// A . - Task> GetByEmployeeIdAsync(Guid employeeId, PagingArgs? paging = null, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); + /// + /// Gets the that contains the items that match the selection criteria. + /// + /// The identifier. + /// The . + /// The optional . + /// The . + /// A . + Task> GetByEmployeeIdAsync(Guid employeeId, PagingArgs? paging = null, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); - /// - /// Creates a new . - /// - /// The . - /// The identifier. - /// The optional . - /// The . - /// A . - Task> CreateAsync(PerformanceReview value, Guid employeeId, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); - } + /// + /// Creates a new . + /// + /// The . + /// The identifier. + /// The optional . + /// The . + /// A . + Task> CreateAsync(PerformanceReview value, Guid employeeId, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); } \ No newline at end of file diff --git a/samples/MyEf.Hr/MyEf.Hr.Common/Agents/Generated/IReferenceDataAgent.cs b/samples/MyEf.Hr/MyEf.Hr.Common/Agents/Generated/IReferenceDataAgent.cs index 74a153445..02a380734 100644 --- a/samples/MyEf.Hr/MyEf.Hr.Common/Agents/Generated/IReferenceDataAgent.cs +++ b/samples/MyEf.Hr/MyEf.Hr.Common/Agents/Generated/IReferenceDataAgent.cs @@ -2,80 +2,65 @@ * This file is automatically generated; any changes will be lost. */ -using System; -using System.Collections.Generic; -using System.Net.Http; -using System.Threading; -using System.Threading.Tasks; -using CoreEx.Configuration; -using CoreEx.Entities; -using CoreEx.Http; -using CoreEx.Json; -using CoreEx.RefData; -using Microsoft.Extensions.Logging; -using MyEf.Hr.Common.Entities; -using RefDataNamespace = MyEf.Hr.Common.Entities; +namespace MyEf.Hr.Common.Agents; -namespace MyEf.Hr.Common.Agents +/// +/// Defines the ReferenceData HTTP agent. +/// +public partial interface IReferenceDataAgent { /// - /// Defines the ReferenceData HTTP agent. + /// Gets all of the items that match the filter arguments. /// - public partial interface IReferenceDataAgent - { - /// - /// Gets all of the items that match the filter arguments. - /// - /// The optional arguments. - /// The optional . - /// The . - /// A . - Task> GenderGetAllAsync(ReferenceDataFilter? args = null, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); + /// The optional arguments. + /// The optional . + /// The . + /// A . + Task> GenderGetAllAsync(ReferenceDataFilter? args = null, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); - /// - /// Gets all of the items that match the filter arguments. - /// - /// The optional arguments. - /// The optional . - /// The . - /// A . - Task> TerminationReasonGetAllAsync(ReferenceDataFilter? args = null, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); + /// + /// Gets all of the items that match the filter arguments. + /// + /// The optional arguments. + /// The optional . + /// The . + /// A . + Task> TerminationReasonGetAllAsync(ReferenceDataFilter? args = null, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); - /// - /// Gets all of the items that match the filter arguments. - /// - /// The optional arguments. - /// The optional . - /// The . - /// A . - Task> RelationshipTypeGetAllAsync(ReferenceDataFilter? args = null, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); + /// + /// Gets all of the items that match the filter arguments. + /// + /// The optional arguments. + /// The optional . + /// The . + /// A . + Task> RelationshipTypeGetAllAsync(ReferenceDataFilter? args = null, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); - /// - /// Gets all of the items that match the filter arguments. - /// - /// The optional arguments. - /// The optional . - /// The . - /// A . - Task> USStateGetAllAsync(ReferenceDataFilter? args = null, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); + /// + /// Gets all of the items that match the filter arguments. + /// + /// The optional arguments. + /// The optional . + /// The . + /// A . + Task> USStateGetAllAsync(ReferenceDataFilter? args = null, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); - /// - /// Gets all of the items that match the filter arguments. - /// - /// The optional arguments. - /// The optional . - /// The . - /// A . - Task> PerformanceOutcomeGetAllAsync(ReferenceDataFilter? args = null, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); + /// + /// Gets all of the items that match the filter arguments. + /// + /// The optional arguments. + /// The optional . + /// The . + /// A . + Task> PerformanceOutcomeGetAllAsync(ReferenceDataFilter? args = null, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); - /// - /// Gets the reference data entries for the specified entities and codes from the query string; e.g: ref?entity=codeX,codeY&entity2=codeZ&entity3 - /// - /// The optional list of reference data names. - /// The optional . - /// The . - /// A . - /// The reference data objects will need to be manually extracted from the corresponding response content. - Task GetNamedAsync(string[] names, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); - } + /// + /// Gets the reference data entries for the specified entities and codes from the query string; e.g: ref?entity=codeX,codeY&entity2=codeZ&entity3 + /// + /// The optional list of reference data names. + /// The optional . + /// The . + /// A . + /// The reference data objects will need to be manually extracted from the corresponding response content. + Task GetNamedAsync(string[] names, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); } \ 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 c0cc91392..5434e5ac4 100644 --- a/samples/MyEf.Hr/MyEf.Hr.Common/Agents/Generated/PerformanceReviewAgent.cs +++ b/samples/MyEf.Hr/MyEf.Hr.Common/Agents/Generated/PerformanceReviewAgent.cs @@ -2,54 +2,42 @@ * This file is automatically generated; any changes will be lost. */ -using System; -using System.Collections.Generic; -using System.Net.Http; -using System.Threading; -using System.Threading.Tasks; -using CoreEx.Entities; -using CoreEx.Http; -using CoreEx.Json; -using MyEf.Hr.Common.Entities; -using RefDataNamespace = MyEf.Hr.Common.Entities; - -namespace MyEf.Hr.Common.Agents +namespace MyEf.Hr.Common.Agents; + +/// +/// Provides the HTTP agent. +/// +public partial class PerformanceReviewAgent : TypedHttpClientBase, IPerformanceReviewAgent { /// - /// Provides the HTTP agent. + /// Initializes a new instance of the class. /// - public partial class PerformanceReviewAgent : TypedHttpClientBase, 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); - - /// - 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); - - /// - 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); - - /// - 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); - - /// - 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); - - /// - 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); - } + /// 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); + + /// + 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); + + /// + 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); + + /// + 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); + + /// + 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); + + /// + 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); } \ 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 ab1178170..8d77d825a 100644 --- a/samples/MyEf.Hr/MyEf.Hr.Common/Agents/Generated/ReferenceDataAgent.cs +++ b/samples/MyEf.Hr/MyEf.Hr.Common/Agents/Generated/ReferenceDataAgent.cs @@ -2,61 +2,48 @@ * This file is automatically generated; any changes will be lost. */ -using System; -using System.Collections.Generic; -using System.Net.Http; -using System.Threading; -using System.Threading.Tasks; -using CoreEx.Entities; -using CoreEx.Http; -using CoreEx.Json; -using CoreEx.RefData; -using MyEf.Hr.Common.Entities; -using RefDataNamespace = MyEf.Hr.Common.Entities; - -namespace MyEf.Hr.Common.Agents +namespace MyEf.Hr.Common.Agents; + +/// +/// Provides the ReferenceData HTTP agent. +/// +public partial class ReferenceDataAgent : TypedHttpClientBase, IReferenceDataAgent { /// - /// Provides the ReferenceData HTTP agent. + /// Initializes a new instance of the class. /// - public partial class ReferenceDataAgent : TypedHttpClientBase, IReferenceDataAgent + /// 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); + + /// + 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); + + /// + 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); + + /// + 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); + + /// + 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); + + /// + public Task GetNamedAsync(string[] names, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) { - /// - /// 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); - - /// - 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); - - /// - 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); - - /// - 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); - - /// - 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); - - /// - public Task GetNamedAsync(string[] names, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) - { - var ro = requestOptions ?? new HttpRequestOptions(); - if (names != null) - ro.UrlQueryString += string.Join("&", names); - - return GetAsync("ref", ro, null, cancellationToken); - } + var ro = requestOptions ?? new HttpRequestOptions(); + if (names != null) + ro.UrlQueryString += string.Join("&", names); + + return GetAsync("ref", ro, null, cancellationToken); } } \ No newline at end of file diff --git a/samples/MyEf.Hr/MyEf.Hr.Common/Entities/Generated/Address.cs b/samples/MyEf.Hr/MyEf.Hr.Common/Entities/Generated/Address.cs index b6186cddf..b4f46d0a5 100644 --- a/samples/MyEf.Hr/MyEf.Hr.Common/Entities/Generated/Address.cs +++ b/samples/MyEf.Hr/MyEf.Hr.Common/Entities/Generated/Address.cs @@ -2,47 +2,40 @@ * This file is automatically generated; any changes will be lost. */ -using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Text.Json.Serialization; -using CoreEx.Entities; +namespace MyEf.Hr.Common.Entities; -namespace MyEf.Hr.Common.Entities +/// +/// Represents the Address entity. +/// +public partial class Address { /// - /// Represents the Address entity. + /// Gets or sets the Street1. /// - public partial class Address - { - /// - /// Gets or sets the Street1. - /// - public string? Street1 { get; set; } + public string? Street1 { get; set; } - /// - /// Gets or sets the Street2. - /// - public string? Street2 { get; set; } + /// + /// Gets or sets the Street2. + /// + public string? Street2 { get; set; } - /// - /// Gets or sets the City. - /// - public string? City { get; set; } + /// + /// Gets or sets the City. + /// + public string? City { get; set; } - /// - /// Gets the corresponding State text (read-only where selected). - /// - public string? StateText { get; set; } + /// + /// Gets the corresponding State text (read-only where selected). + /// + public string? StateText { get; set; } - /// - /// Gets or sets the State code. - /// - public string? State { get; set; } + /// + /// Gets or sets the State code. + /// + public string? State { get; set; } - /// - /// Gets or sets the Post Code. - /// - public string? PostCode { get; set; } - } -} \ No newline at end of file + /// + /// Gets or sets the Post Code. + /// + public string? PostCode { get; set; } +} diff --git a/samples/MyEf.Hr/MyEf.Hr.Common/Entities/Generated/EmergencyContact.cs b/samples/MyEf.Hr/MyEf.Hr.Common/Entities/Generated/EmergencyContact.cs index d6b620c08..721d94716 100644 --- a/samples/MyEf.Hr/MyEf.Hr.Common/Entities/Generated/EmergencyContact.cs +++ b/samples/MyEf.Hr/MyEf.Hr.Common/Entities/Generated/EmergencyContact.cs @@ -2,52 +2,45 @@ * This file is automatically generated; any changes will be lost. */ -using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Text.Json.Serialization; -using CoreEx.Entities; +namespace MyEf.Hr.Common.Entities; -namespace MyEf.Hr.Common.Entities +/// +/// Represents the Emergency Contact entity. +/// +public partial class EmergencyContact : IIdentifier { /// - /// Represents the Emergency Contact entity. + /// Gets or sets the identifier. /// - public partial class EmergencyContact : IIdentifier - { - /// - /// Gets or sets the identifier. - /// - public Guid Id { get; set; } - - /// - /// Gets or sets the First Name. - /// - public string? FirstName { get; set; } - - /// - /// Gets or sets the Last Name. - /// - public string? LastName { get; set; } - - /// - /// Gets or sets the Phone No. - /// - public string? PhoneNo { get; set; } - - /// - /// Gets the corresponding Relationship text (read-only where selected). - /// - public string? RelationshipText { get; set; } - - /// - /// Gets or sets the Relationship code. - /// - public string? Relationship { get; set; } - } + public Guid Id { get; set; } /// - /// Represents the EmergencyContact collection. + /// Gets or sets the First Name. /// - public partial class EmergencyContactCollection : List { } -} \ No newline at end of file + public string? FirstName { get; set; } + + /// + /// Gets or sets the Last Name. + /// + public string? LastName { get; set; } + + /// + /// Gets or sets the Phone No. + /// + public string? PhoneNo { get; set; } + + /// + /// Gets the corresponding Relationship text (read-only where selected). + /// + public string? RelationshipText { get; set; } + + /// + /// Gets or sets the Relationship code. + /// + public string? Relationship { get; set; } +} + +/// +/// Represents the EmergencyContact collection. +/// +public partial class EmergencyContactCollection : List { } diff --git a/samples/MyEf.Hr/MyEf.Hr.Common/Entities/Generated/Employee.cs b/samples/MyEf.Hr/MyEf.Hr.Common/Entities/Generated/Employee.cs index 7cf1bca41..962a872a4 100644 --- a/samples/MyEf.Hr/MyEf.Hr.Common/Entities/Generated/Employee.cs +++ b/samples/MyEf.Hr/MyEf.Hr.Common/Entities/Generated/Employee.cs @@ -2,38 +2,31 @@ * This file is automatically generated; any changes will be lost. */ -using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Text.Json.Serialization; -using CoreEx.Entities; +namespace MyEf.Hr.Common.Entities; -namespace MyEf.Hr.Common.Entities +/// +/// Represents the Employee entity. +/// +public partial class Employee : EmployeeBase, IETag, IChangeLog { /// - /// Represents the Employee entity. + /// Gets or sets the Address. /// - public partial class Employee : EmployeeBase, IETag, IChangeLog - { - /// - /// Gets or sets the Address. - /// - public Address? Address { get; set; } + public Address? Address { get; set; } - /// - /// Gets or sets the Emergency Contacts. - /// - public EmergencyContactCollection? EmergencyContacts { get; set; } + /// + /// Gets or sets the Emergency Contacts. + /// + public EmergencyContactCollection? EmergencyContacts { get; set; } - /// - /// Gets or sets the ETag. - /// - [JsonPropertyName("etag")] - public string? ETag { get; set; } + /// + /// Gets or sets the ETag. + /// + [JsonPropertyName("etag")] + public string? ETag { get; set; } - /// - /// Gets or sets the Change Log. - /// - public ChangeLog? ChangeLog { get; set; } - } + /// + /// Gets or sets the Change Log. + /// + public ChangeLog? ChangeLog { get; set; } } \ No newline at end of file diff --git a/samples/MyEf.Hr/MyEf.Hr.Common/Entities/Generated/EmployeeArgs.cs b/samples/MyEf.Hr/MyEf.Hr.Common/Entities/Generated/EmployeeArgs.cs index ee89fa0bb..30935c69e 100644 --- a/samples/MyEf.Hr/MyEf.Hr.Common/Entities/Generated/EmployeeArgs.cs +++ b/samples/MyEf.Hr/MyEf.Hr.Common/Entities/Generated/EmployeeArgs.cs @@ -2,48 +2,41 @@ * This file is automatically generated; any changes will be lost. */ -using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Text.Json.Serialization; -using CoreEx.Entities; +namespace MyEf.Hr.Common.Entities; -namespace MyEf.Hr.Common.Entities +/// +/// Represents the Employee Arguments entity. +/// +public partial class EmployeeArgs { /// - /// Represents the Employee Arguments entity. + /// Gets or sets the First Name. /// - public partial class EmployeeArgs - { - /// - /// Gets or sets the First Name. - /// - public string? FirstName { get; set; } + public string? FirstName { get; set; } - /// - /// Gets or sets the Last Name. - /// - public string? LastName { get; set; } + /// + /// Gets or sets the Last Name. + /// + public string? LastName { get; set; } - /// - /// Gets or sets the Genders code(s). - /// - public List? Genders { get; set; } + /// + /// Gets or sets the Genders code(s). + /// + public List? Genders { get; set; } - /// - /// Gets or sets the Start From. - /// - public DateTime? StartFrom { get; set; } + /// + /// Gets or sets the Start From. + /// + public DateTime? StartFrom { get; set; } - /// - /// Gets or sets the Start To. - /// - public DateTime? StartTo { get; set; } + /// + /// Gets or sets the Start To. + /// + public DateTime? StartTo { get; set; } - /// - /// Indicates whether Is Include Terminated. - /// - [JsonPropertyName("includeTerminated")] - public bool? IsIncludeTerminated { get; set; } - } -} \ No newline at end of file + /// + /// Indicates whether Is Include Terminated. + /// + [JsonPropertyName("includeTerminated")] + public bool? IsIncludeTerminated { get; set; } +} diff --git a/samples/MyEf.Hr/MyEf.Hr.Common/Entities/Generated/EmployeeBase.cs b/samples/MyEf.Hr/MyEf.Hr.Common/Entities/Generated/EmployeeBase.cs index ff939d26e..b385e9d40 100644 --- a/samples/MyEf.Hr/MyEf.Hr.Common/Entities/Generated/EmployeeBase.cs +++ b/samples/MyEf.Hr/MyEf.Hr.Common/Entities/Generated/EmployeeBase.cs @@ -2,96 +2,89 @@ * This file is automatically generated; any changes will be lost. */ -using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Text.Json.Serialization; -using CoreEx.Entities; +namespace MyEf.Hr.Common.Entities; -namespace MyEf.Hr.Common.Entities +/// +/// Represents the Employee base entity. +/// +public partial class EmployeeBase : IIdentifier { /// - /// Represents the Employee base entity. + /// Gets or sets the Employee identifier. /// - public partial class EmployeeBase : IIdentifier - { - /// - /// Gets or sets the Employee identifier. - /// - public Guid Id { get; set; } + public Guid Id { get; set; } - /// - /// Gets or sets the Unique Employee Email. - /// - public string? Email { get; set; } - - /// - /// Gets or sets the First Name. - /// - public string? FirstName { get; set; } + /// + /// Gets or sets the Unique Employee Email. + /// + public string? Email { get; set; } - /// - /// Gets or sets the Last Name. - /// - public string? LastName { get; set; } + /// + /// Gets or sets the First Name. + /// + public string? FirstName { get; set; } - /// - /// Gets the corresponding Gender text (read-only where selected). - /// - public string? GenderText { get; set; } + /// + /// Gets or sets the Last Name. + /// + public string? LastName { get; set; } - /// - /// Gets or sets the Gender code. - /// - public string? Gender { get; set; } + /// + /// Gets the corresponding Gender text (read-only where selected). + /// + public string? GenderText { get; set; } - /// - /// Gets or sets the Birthday. - /// - public DateTime Birthday { get; set; } + /// + /// Gets or sets the Gender code. + /// + public string? Gender { get; set; } - /// - /// Gets or sets the Start Date. - /// - public DateTime StartDate { get; set; } + /// + /// Gets or sets the Birthday. + /// + public DateTime Birthday { get; set; } - /// - /// Gets or sets the Termination. - /// - public TerminationDetail? Termination { get; set; } + /// + /// Gets or sets the Start Date. + /// + public DateTime StartDate { get; set; } - /// - /// Gets or sets the Phone No. - /// - public string? PhoneNo { get; set; } - } + /// + /// Gets or sets the Termination. + /// + public TerminationDetail? Termination { get; set; } /// - /// Represents the EmployeeBase collection. + /// Gets or sets the Phone No. /// - public partial class EmployeeBaseCollection : List { } + public string? PhoneNo { get; set; } +} + +/// +/// Represents the EmployeeBase collection. +/// +public partial class EmployeeBaseCollection : List { } +/// +/// Represents the EmployeeBase collection result. +/// +public class EmployeeBaseCollectionResult : CollectionResult +{ + /// + /// Initializes a new instance of the class. + /// + public EmployeeBaseCollectionResult() { } + + /// + /// Initializes a new instance of the class with . + /// + /// The . + public EmployeeBaseCollectionResult(PagingArgs? paging) : base(paging) { } + /// - /// Represents the EmployeeBase collection result. + /// Initializes a new instance of the class with to add. /// - public class EmployeeBaseCollectionResult : CollectionResult - { - /// - /// Initializes a new instance of the class. - /// - public EmployeeBaseCollectionResult() { } - - /// - /// Initializes a new instance of the class with . - /// - /// The . - public EmployeeBaseCollectionResult(PagingArgs? paging) : base(paging) { } - - /// - /// Initializes a new instance of the class with to add. - /// - /// The items to add. - /// The . - public EmployeeBaseCollectionResult(IEnumerable items, PagingArgs? paging = null) : base(paging) => Items.AddRange(items); - } -} \ No newline at end of file + /// The items to add. + /// The . + public EmployeeBaseCollectionResult(IEnumerable items, PagingArgs? paging = null) : base(paging) => Items.AddRange(items); +} diff --git a/samples/MyEf.Hr/MyEf.Hr.Common/Entities/Generated/Gender.cs b/samples/MyEf.Hr/MyEf.Hr.Common/Entities/Generated/Gender.cs index d0f45420a..ee09adf57 100644 --- a/samples/MyEf.Hr/MyEf.Hr.Common/Entities/Generated/Gender.cs +++ b/samples/MyEf.Hr/MyEf.Hr.Common/Entities/Generated/Gender.cs @@ -2,22 +2,14 @@ * This file is automatically generated; any changes will be lost. */ -using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Text.Json.Serialization; -using CoreEx.Entities; -using CoreEx.RefData; +namespace MyEf.Hr.Common.Entities; -namespace MyEf.Hr.Common.Entities -{ - /// - /// Represents the Gender entity. - /// - public partial class Gender : ReferenceDataBase { } +/// +/// Represents the Gender entity. +/// +public partial class Gender : ReferenceDataBase { } - /// - /// Represents the Gender collection. - /// - public partial class GenderCollection : List { } -} \ No newline at end of file +/// +/// Represents the Gender collection. +/// +public partial class GenderCollection : List { } diff --git a/samples/MyEf.Hr/MyEf.Hr.Common/Entities/Generated/PerformanceOutcome.cs b/samples/MyEf.Hr/MyEf.Hr.Common/Entities/Generated/PerformanceOutcome.cs index 3f4be7b15..03bab523c 100644 --- a/samples/MyEf.Hr/MyEf.Hr.Common/Entities/Generated/PerformanceOutcome.cs +++ b/samples/MyEf.Hr/MyEf.Hr.Common/Entities/Generated/PerformanceOutcome.cs @@ -2,22 +2,14 @@ * This file is automatically generated; any changes will be lost. */ -using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Text.Json.Serialization; -using CoreEx.Entities; -using CoreEx.RefData; +namespace MyEf.Hr.Common.Entities; -namespace MyEf.Hr.Common.Entities -{ - /// - /// Represents the Performance Outcome entity. - /// - public partial class PerformanceOutcome : ReferenceDataBase { } +/// +/// Represents the Performance Outcome entity. +/// +public partial class PerformanceOutcome : ReferenceDataBase { } - /// - /// Represents the PerformanceOutcome collection. - /// - public partial class PerformanceOutcomeCollection : List { } -} \ No newline at end of file +/// +/// Represents the PerformanceOutcome collection. +/// +public partial class PerformanceOutcomeCollection : List { } diff --git a/samples/MyEf.Hr/MyEf.Hr.Common/Entities/Generated/PerformanceReview.cs b/samples/MyEf.Hr/MyEf.Hr.Common/Entities/Generated/PerformanceReview.cs index 925ae5574..fbfcf92fe 100644 --- a/samples/MyEf.Hr/MyEf.Hr.Common/Entities/Generated/PerformanceReview.cs +++ b/samples/MyEf.Hr/MyEf.Hr.Common/Entities/Generated/PerformanceReview.cs @@ -2,92 +2,85 @@ * This file is automatically generated; any changes will be lost. */ -using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Text.Json.Serialization; -using CoreEx.Entities; +namespace MyEf.Hr.Common.Entities; -namespace MyEf.Hr.Common.Entities +/// +/// Represents the Performance Review entity. +/// +public partial class PerformanceReview : IIdentifier, IETag, IChangeLog { /// - /// Represents the Performance Review entity. + /// Gets or sets the PerformanceReview identifier. /// - public partial class PerformanceReview : IIdentifier, IETag, IChangeLog - { - /// - /// Gets or sets the PerformanceReview identifier. - /// - public Guid Id { get; set; } + public Guid Id { get; set; } - /// - /// Gets or sets the Employee.Id (value is immutable). - /// - public Guid EmployeeId { get; set; } - - /// - /// Gets or sets the Date. - /// - public DateTime Date { get; set; } + /// + /// Gets or sets the Employee.Id (value is immutable). + /// + public Guid EmployeeId { get; set; } - /// - /// Gets the corresponding Outcome text (read-only where selected). - /// - public string? OutcomeText { get; set; } + /// + /// Gets or sets the Date. + /// + public DateTime Date { get; set; } - /// - /// Gets or sets the Outcome code. - /// - public string? Outcome { get; set; } + /// + /// Gets the corresponding Outcome text (read-only where selected). + /// + public string? OutcomeText { get; set; } - /// - /// Gets or sets the Reviewer. - /// - public string? Reviewer { get; set; } + /// + /// Gets or sets the Outcome code. + /// + public string? Outcome { get; set; } - /// - /// Gets or sets the Notes. - /// - public string? Notes { get; set; } + /// + /// Gets or sets the Reviewer. + /// + public string? Reviewer { get; set; } - /// - /// Gets or sets the ETag. - /// - [JsonPropertyName("etag")] - public string? ETag { get; set; } + /// + /// Gets or sets the Notes. + /// + public string? Notes { get; set; } - /// - /// Gets or sets the Change Log. - /// - public ChangeLog? ChangeLog { get; set; } - } + /// + /// Gets or sets the ETag. + /// + [JsonPropertyName("etag")] + public string? ETag { get; set; } /// - /// Represents the PerformanceReview collection. + /// Gets or sets the Change Log. /// - public partial class PerformanceReviewCollection : List { } + public ChangeLog? ChangeLog { get; set; } +} + +/// +/// Represents the PerformanceReview collection. +/// +public partial class PerformanceReviewCollection : List { } +/// +/// Represents the PerformanceReview collection result. +/// +public class PerformanceReviewCollectionResult : CollectionResult +{ + /// + /// Initializes a new instance of the class. + /// + public PerformanceReviewCollectionResult() { } + + /// + /// Initializes a new instance of the class with . + /// + /// The . + public PerformanceReviewCollectionResult(PagingArgs? paging) : base(paging) { } + /// - /// Represents the PerformanceReview collection result. + /// Initializes a new instance of the class with to add. /// - public class PerformanceReviewCollectionResult : CollectionResult - { - /// - /// Initializes a new instance of the class. - /// - public PerformanceReviewCollectionResult() { } - - /// - /// Initializes a new instance of the class with . - /// - /// The . - public PerformanceReviewCollectionResult(PagingArgs? paging) : base(paging) { } - - /// - /// Initializes a new instance of the class with to add. - /// - /// The items to add. - /// The . - public PerformanceReviewCollectionResult(IEnumerable items, PagingArgs? paging = null) : base(paging) => Items.AddRange(items); - } -} \ No newline at end of file + /// The items to add. + /// The . + public PerformanceReviewCollectionResult(IEnumerable items, PagingArgs? paging = null) : base(paging) => Items.AddRange(items); +} diff --git a/samples/MyEf.Hr/MyEf.Hr.Common/Entities/Generated/RelationshipType.cs b/samples/MyEf.Hr/MyEf.Hr.Common/Entities/Generated/RelationshipType.cs index 203a0e225..da1ac5141 100644 --- a/samples/MyEf.Hr/MyEf.Hr.Common/Entities/Generated/RelationshipType.cs +++ b/samples/MyEf.Hr/MyEf.Hr.Common/Entities/Generated/RelationshipType.cs @@ -2,22 +2,14 @@ * This file is automatically generated; any changes will be lost. */ -using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Text.Json.Serialization; -using CoreEx.Entities; -using CoreEx.RefData; +namespace MyEf.Hr.Common.Entities; -namespace MyEf.Hr.Common.Entities -{ - /// - /// Represents the Relationship Type entity. - /// - public partial class RelationshipType : ReferenceDataBase { } +/// +/// Represents the Relationship Type entity. +/// +public partial class RelationshipType : ReferenceDataBase { } - /// - /// Represents the RelationshipType collection. - /// - public partial class RelationshipTypeCollection : List { } -} \ No newline at end of file +/// +/// Represents the RelationshipType collection. +/// +public partial class RelationshipTypeCollection : List { } diff --git a/samples/MyEf.Hr/MyEf.Hr.Common/Entities/Generated/TerminationDetail.cs b/samples/MyEf.Hr/MyEf.Hr.Common/Entities/Generated/TerminationDetail.cs index 712ba3c7d..741a4dda6 100644 --- a/samples/MyEf.Hr/MyEf.Hr.Common/Entities/Generated/TerminationDetail.cs +++ b/samples/MyEf.Hr/MyEf.Hr.Common/Entities/Generated/TerminationDetail.cs @@ -2,32 +2,25 @@ * This file is automatically generated; any changes will be lost. */ -using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Text.Json.Serialization; -using CoreEx.Entities; +namespace MyEf.Hr.Common.Entities; -namespace MyEf.Hr.Common.Entities +/// +/// Represents the Termination Detail entity. +/// +public partial class TerminationDetail { /// - /// Represents the Termination Detail entity. + /// Gets or sets the Date. /// - public partial class TerminationDetail - { - /// - /// Gets or sets the Date. - /// - public DateTime Date { get; set; } + public DateTime Date { get; set; } - /// - /// Gets the corresponding Reason text (read-only where selected). - /// - public string? ReasonText { get; set; } + /// + /// Gets the corresponding Reason text (read-only where selected). + /// + public string? ReasonText { get; set; } - /// - /// Gets or sets the Reason code. - /// - public string? Reason { get; set; } - } -} \ No newline at end of file + /// + /// Gets or sets the Reason code. + /// + public string? Reason { get; set; } +} diff --git a/samples/MyEf.Hr/MyEf.Hr.Common/Entities/Generated/TerminationReason.cs b/samples/MyEf.Hr/MyEf.Hr.Common/Entities/Generated/TerminationReason.cs index 5673b7a42..0efafe8f4 100644 --- a/samples/MyEf.Hr/MyEf.Hr.Common/Entities/Generated/TerminationReason.cs +++ b/samples/MyEf.Hr/MyEf.Hr.Common/Entities/Generated/TerminationReason.cs @@ -2,22 +2,14 @@ * This file is automatically generated; any changes will be lost. */ -using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Text.Json.Serialization; -using CoreEx.Entities; -using CoreEx.RefData; +namespace MyEf.Hr.Common.Entities; -namespace MyEf.Hr.Common.Entities -{ - /// - /// Represents the Termination Reason entity. - /// - public partial class TerminationReason : ReferenceDataBase { } +/// +/// Represents the Termination Reason entity. +/// +public partial class TerminationReason : ReferenceDataBase { } - /// - /// Represents the TerminationReason collection. - /// - public partial class TerminationReasonCollection : List { } -} \ No newline at end of file +/// +/// Represents the TerminationReason collection. +/// +public partial class TerminationReasonCollection : List { } diff --git a/samples/MyEf.Hr/MyEf.Hr.Common/Entities/Generated/USState.cs b/samples/MyEf.Hr/MyEf.Hr.Common/Entities/Generated/USState.cs index 977e77989..7fece7522 100644 --- a/samples/MyEf.Hr/MyEf.Hr.Common/Entities/Generated/USState.cs +++ b/samples/MyEf.Hr/MyEf.Hr.Common/Entities/Generated/USState.cs @@ -2,22 +2,14 @@ * This file is automatically generated; any changes will be lost. */ -using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Text.Json.Serialization; -using CoreEx.Entities; -using CoreEx.RefData; +namespace MyEf.Hr.Common.Entities; -namespace MyEf.Hr.Common.Entities -{ - /// - /// Represents the US State entity. - /// - public partial class USState : ReferenceDataBase { } +/// +/// Represents the US State entity. +/// +public partial class USState : ReferenceDataBase { } - /// - /// Represents the USState collection. - /// - public partial class USStateCollection : List { } -} \ No newline at end of file +/// +/// Represents the USState collection. +/// +public partial class USStateCollection : List { } diff --git a/samples/MyEf.Hr/MyEf.Hr.Common/GlobalUsings.cs b/samples/MyEf.Hr/MyEf.Hr.Common/GlobalUsings.cs new file mode 100644 index 000000000..de1022ab0 --- /dev/null +++ b/samples/MyEf.Hr/MyEf.Hr.Common/GlobalUsings.cs @@ -0,0 +1,13 @@ +global using CoreEx.Entities; +global using CoreEx.Http; +global using CoreEx.Json; +global using CoreEx.RefData; +global using System; +global using System.Collections.Generic; +global using System.Diagnostics.CodeAnalysis; +global using System.Text.Json.Serialization; +global using System.Net.Http; +global using System.Threading; +global using System.Threading.Tasks; +global using MyEf.Hr.Common.Entities; +global using RefDataNamespace = MyEf.Hr.Common.Entities; \ No newline at end of file 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 9f5217397..bb7037712 100644 --- a/samples/MyEf.Hr/MyEf.Hr.Common/MyEf.Hr.Common.csproj +++ b/samples/MyEf.Hr/MyEf.Hr.Common/MyEf.Hr.Common.csproj @@ -3,6 +3,8 @@ netstandard2.1 enable True + Preview + true diff --git a/templates/Beef.Template.Solution/Beef.Template.Solution.csproj b/templates/Beef.Template.Solution/Beef.Template.Solution.csproj index c82dcef3b..7cdab7e32 100644 --- a/templates/Beef.Template.Solution/Beef.Template.Solution.csproj +++ b/templates/Beef.Template.Solution/Beef.Template.Solution.csproj @@ -19,6 +19,7 @@ + diff --git a/templates/Beef.Template.Solution/content/.template.config/template.json b/templates/Beef.Template.Solution/content/.template.config/template.json index 354581c36..0851327ad 100644 --- a/templates/Beef.Template.Solution/content/.template.config/template.json +++ b/templates/Beef.Template.Solution/content/.template.config/template.json @@ -93,7 +93,7 @@ "type": "generated", "generator": "constant", "parameters": { - "value": "5.16.2" + "value": "5.17.0" }, "replaces": "BeefVersion" }, diff --git a/templates/Beef.Template.Solution/content/Company.AppName.Common/Company.AppName.Common.csproj b/templates/Beef.Template.Solution/content/Company.AppName.Common/Company.AppName.Common.csproj index aa454b4fc..d7714d7b3 100644 --- a/templates/Beef.Template.Solution/content/Company.AppName.Common/Company.AppName.Common.csproj +++ b/templates/Beef.Template.Solution/content/Company.AppName.Common/Company.AppName.Common.csproj @@ -2,6 +2,8 @@ netstandard2.1 enable + Preview + true diff --git a/templates/Beef.Template.Solution/content/Company.AppName.Common/GlobalUsings.cs b/templates/Beef.Template.Solution/content/Company.AppName.Common/GlobalUsings.cs new file mode 100644 index 000000000..9961e3abc --- /dev/null +++ b/templates/Beef.Template.Solution/content/Company.AppName.Common/GlobalUsings.cs @@ -0,0 +1,13 @@ +global using CoreEx.Entities; +global using CoreEx.Http; +global using CoreEx.Json; +global using CoreEx.RefData; +global using System; +global using System.Collections.Generic; +global using System.Diagnostics.CodeAnalysis; +global using System.Text.Json.Serialization; +global using System.Net.Http; +global using System.Threading; +global using System.Threading.Tasks; +global using Company.AppName.Common.Entities; +global using RefDataNamespace = Company.AppName.Common.Entities; \ No newline at end of file diff --git a/tools/Beef.CodeGen.Core/Config/Entity/CodeGenConfig.cs b/tools/Beef.CodeGen.Core/Config/Entity/CodeGenConfig.cs index bfe9160c2..4c7a80886 100644 --- a/tools/Beef.CodeGen.Core/Config/Entity/CodeGenConfig.cs +++ b/tools/Beef.CodeGen.Core/Config/Entity/CodeGenConfig.cs @@ -38,8 +38,9 @@ namespace Beef.CodeGen.Config.Entity [CodeGenCategory("OData", Title = "Provides the _OData Data-layer_ configuration.")] [CodeGenCategory("HttpAgent", Title = "Provides the _HTTP Agent Data-layer_ configuration.")] [CodeGenCategory("gRPC", Title = "Provides the _gRPC_ configuration.")] - [CodeGenCategory("Path", Title = "Provides the _Path (Directory)_ configuration for the generated artefacts.")] - [CodeGenCategory("Namespace", Title = "Provides the _.NET Namespace_ configuration for the generated artefacts.")] + [CodeGenCategory("Path", Title = "Provides the _Path (Directory)_ configuration.")] + [CodeGenCategory("Namespace", Title = "Provides the _.NET Namespace_ configuration.")] + [CodeGenCategory("Auth", Title = "Provides the _Authorization_ configuration.")] [CodeGenCategory("Collections", Title = "Provides related child (hierarchical) configuration.")] public class CodeGenConfig : ConfigRootBase { @@ -503,6 +504,38 @@ public class CodeGenConfig : ConfigRootBase #endregion + #region Auth + + /// + /// Gets the default auth action for a create. + /// + [JsonPropertyName("authActionCreate")] + [CodeGenProperty("Auth", Title = "The default `Operation.AuthAction` for an `Operation.Type` of `Create`.", Description = "Defaults to `Create`.")] + public string? AuthActionCreate { get; set; } + + /// + /// Gets the default auth action for a get or getcoll. + /// + [JsonPropertyName("authActionRead")] + [CodeGenProperty("Auth", Title = "The default `Operation.AuthAction` for an `Operation.Type` of `Get` or `GetColl`.", Description = "Defaults to `Read`.")] + public string? AuthActionRead { get; set; } + + /// + /// Gets the default auth action for a update. + /// + [JsonPropertyName("authActionUpdate")] + [CodeGenProperty("Auth", Title = "The default `Operation.AuthAction` for an `Operation.Type` of `Update`.", Description = "Defaults to `Update`.")] + public string? AuthActionUpdate { get; set; } + + /// + /// Gets the default auth action for a delete. + /// + [JsonPropertyName("authActionDelete")] + [CodeGenProperty("Auth", Title = "The default `Operation.AuthAction` for an `Operation.Type` of `Delete`.", Description = "Defaults to `Delete`.")] + public string? AuthActionDelete { get; set; } + + #endregion + /// /// Gets or sets the corresponding collection. /// @@ -634,6 +667,11 @@ protected override async Task PrepareAsync() RefDataSortOrderDataName = DefaultWhereNull(RefDataSortOrderDataName, () => "SortOrder"); WebApiTags ??= []; + AuthActionCreate = DefaultWhereNull(AuthActionCreate, () => "Create"); + AuthActionRead = DefaultWhereNull(AuthActionRead, () => "Read"); + AuthActionUpdate = DefaultWhereNull(AuthActionUpdate, () => "Update"); + AuthActionDelete = DefaultWhereNull(AuthActionDelete, () => "Delete"); + if (!string.IsNullOrEmpty(WebApiRoutePrefix)) RefDataWebApiRoute = string.IsNullOrEmpty(RefDataWebApiRoute) ? WebApiRoutePrefix : $"{(WebApiRoutePrefix.EndsWith('/') ? WebApiRoutePrefix[..^1] : WebApiRoutePrefix)}/{(RefDataWebApiRoute.StartsWith('/') ? RefDataWebApiRoute[1..] : RefDataWebApiRoute)}"; diff --git a/tools/Beef.CodeGen.Core/Config/Entity/EntityConfig.cs b/tools/Beef.CodeGen.Core/Config/Entity/EntityConfig.cs index 3c5beb25c..bf5b3232d 100644 --- a/tools/Beef.CodeGen.Core/Config/Entity/EntityConfig.cs +++ b/tools/Beef.CodeGen.Core/Config/Entity/EntityConfig.cs @@ -1748,19 +1748,19 @@ private async Task PrepareOperationsAsync() // Add in selected operations where applicable (in reverse order in which output). if (CompareValue(Delete, true) && !Operations.Any(x => x.Name == "Delete")) - Operations.Insert(0, new OperationConfig { Name = "Delete", Type = "Delete", PrimaryKey = true, AuthAction = "Delete" }); + Operations.Insert(0, new OperationConfig { Name = "Delete", Type = "Delete", PrimaryKey = true }); if (CompareValue(Patch, true) && !Operations.Any(x => x.Name == "Patch")) Operations.Insert(0, new OperationConfig { Name = "Patch", Type = "Patch", PrimaryKey = true }); if (CompareValue(Update, true) && !Operations.Any(x => x.Name == "Update")) - Operations.Insert(0, new OperationConfig { Name = "Update", Type = "Update", PrimaryKey = true, AuthAction = "Update" }); + Operations.Insert(0, new OperationConfig { Name = "Update", Type = "Update", PrimaryKey = true }); if (CompareValue(Create, true) && !Operations.Any(x => x.Name == "Create")) - Operations.Insert(0, new OperationConfig { Name = "Create", Type = "Create", WebApiRoute = "", AuthAction = "Create" }); + Operations.Insert(0, new OperationConfig { Name = "Create", Type = "Create", WebApiRoute = "" }); if (CompareValue(Get, true) && !Operations.Any(x => x.Name == "Get")) - Operations.Insert(0, new OperationConfig { Name = "Get", Type = "Get", PrimaryKey = true, AuthAction = "Read" }); + Operations.Insert(0, new OperationConfig { Name = "Get", Type = "Get", PrimaryKey = true }); if (CompareValue(GetByArgs, true) && !Operations.Any(x => x.Name == "GetByArgs")) { @@ -1771,10 +1771,10 @@ private async Task PrepareOperationsAsync() } if (CompareValue(GetAll, true) && !Operations.Any(x => x.Name == "GetAll")) - Operations.Insert(0, new OperationConfig { Name = "GetAll", Type = "GetColl", WebApiRoute = GetByArgs is not null && GetByArgs.Value ? "all" : "", AuthAction = "Read" }); + Operations.Insert(0, new OperationConfig { Name = "GetAll", Type = "GetColl", WebApiRoute = GetByArgs is not null && GetByArgs.Value ? "all" : "" }); if (CompareValue(GetByQuery, true) && !Operations.Any(x => x.Name == "GetByQuery")) - Operations.Insert(0, new OperationConfig { Name = "GetByQuery", Type = "GetColl", Paging = true, Query = true, WebApiRoute = "query", AuthAction = "Read" }); + Operations.Insert(0, new OperationConfig { Name = "GetByQuery", Type = "GetColl", Paging = true, Query = true, WebApiRoute = "query" }); // Prepare each operations. foreach (var operation in Operations) diff --git a/tools/Beef.CodeGen.Core/Config/Entity/OperationConfig.cs b/tools/Beef.CodeGen.Core/Config/Entity/OperationConfig.cs index ca429396a..cb5c0c01f 100644 --- a/tools/Beef.CodeGen.Core/Config/Entity/OperationConfig.cs +++ b/tools/Beef.CodeGen.Core/Config/Entity/OperationConfig.cs @@ -1148,6 +1148,15 @@ protected override async Task PrepareAsync() _ => HasReturnValue ? $"A resultant {{{{{ReturnType}}}}}" : null })) + "."; + AuthAction = DefaultWhereNull(AuthAction, () => Type switch + { + "Get" or "GetColl" => Root!.AuthActionRead, + "Create" => Root!.AuthActionCreate, + "Update" => Root!.AuthActionUpdate, + "Delete" => Root!.AuthActionDelete, + _ => null + }); + WebApiReturnText = Type == "GetColl" ? StringConverter.ToComments($"The {{{{{BaseReturnType}Collection}}}}") : ReturnText; PrivateName = DefaultWhereNull(PrivateName, () => StringConverter.ToPrivateCase(Name)); diff --git a/tools/Beef.CodeGen.Core/Schema/entity.beef-5.json b/tools/Beef.CodeGen.Core/Schema/entity.beef-5.json index 3786110ca..9dca65305 100644 --- a/tools/Beef.CodeGen.Core/Schema/entity.beef-5.json +++ b/tools/Beef.CodeGen.Core/Schema/entity.beef-5.json @@ -350,6 +350,26 @@ "title": "The Namespace (root) for the Api-related .NET artefacts.", "description": "Defaults to \u0060NamespaceBase\u0060 \u002B \u0060.\u0060 \u002B \u0060ApiName\u0060 (runtime parameter). For example \u0060Beef.Demo.Api\u0060." }, + "authActionCreate": { + "type": "string", + "title": "The default \u0060Operation.AuthAction\u0060 for an \u0060Operation.Type\u0060 of \u0060Create\u0060.", + "description": "Defaults to \u0060Create\u0060." + }, + "authActionRead": { + "type": "string", + "title": "The default \u0060Operation.AuthAction\u0060 for an \u0060Operation.Type\u0060 of \u0060Get\u0060 or \u0060GetColl\u0060.", + "description": "Defaults to \u0060Read\u0060." + }, + "authActionUpdate": { + "type": "string", + "title": "The default \u0060Operation.AuthAction\u0060 for an \u0060Operation.Type\u0060 of \u0060Update\u0060.", + "description": "Defaults to \u0060Update\u0060." + }, + "authActionDelete": { + "type": "string", + "title": "The default \u0060Operation.AuthAction\u0060 for an \u0060Operation.Type\u0060 of \u0060Delete\u0060.", + "description": "Defaults to \u0060Delete\u0060." + }, "entities": { "type": "array", "title": "The corresponding \u0060Entity\u0060 collection.", diff --git a/tools/Beef.CodeGen.Core/Templates/EntityIWebApiAgent_cs.hbs b/tools/Beef.CodeGen.Core/Templates/EntityIWebApiAgent_cs.hbs index 8c5a045aa..35a643b5d 100644 --- a/tools/Beef.CodeGen.Core/Templates/EntityIWebApiAgent_cs.hbs +++ b/tools/Beef.CodeGen.Core/Templates/EntityIWebApiAgent_cs.hbs @@ -8,47 +8,31 @@ #pragma warning disable {{/if}} -using System; -using System.Collections.Generic; -using System.Net.Http; -using System.Threading; -using System.Threading.Tasks; -using CoreEx.Configuration; -using CoreEx.Entities; -using CoreEx.Http; -using CoreEx.Json; -using Microsoft.Extensions.Logging; -using {{Root.NamespaceCommon}}.Entities; -{{#ifval Root.RefDataCommonNamespace}} -using RefDataNamespace = {{Root.RefDataCommonNamespace}}; -{{/ifval}} +namespace {{Root.NamespaceCommon}}.Agents; -namespace {{Root.NamespaceCommon}}.Agents +/// +/// Defines the {{{EntityNameSeeComments}}} HTTP agent. +/// +public partial interface I{{Name}}Agent { - /// - /// Defines the {{{EntityNameSeeComments}}} HTTP agent. - /// - public partial interface I{{Name}}Agent - { {{#each WebApiAgentOperations}} {{#unless @first}} {{/unless}} - /// - /// {{{SummaryText}}} - /// + /// + /// {{{SummaryText}}} + /// {{#ifeq Type 'Patch'}} - /// The . + /// The . {{/ifeq}} {{#each Parameters}} - /// {{{WebApiSummaryText}}} + /// {{{WebApiSummaryText}}} {{/each}} - /// The optional . - /// The . - /// A . - {{{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); + /// The optional . + /// The . + /// A . + {{{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); {{/each}} - } }{{#if Root.PreprocessorDirectives}} #pragma warning restore diff --git a/tools/Beef.CodeGen.Core/Templates/EntityWebApiAgent_cs.hbs b/tools/Beef.CodeGen.Core/Templates/EntityWebApiAgent_cs.hbs index a2f38c39a..a60efd966 100644 --- a/tools/Beef.CodeGen.Core/Templates/EntityWebApiAgent_cs.hbs +++ b/tools/Beef.CodeGen.Core/Templates/EntityWebApiAgent_cs.hbs @@ -8,40 +8,26 @@ #pragma warning disable {{/if}} -using System; -using System.Collections.Generic; -using System.Net.Http; -using System.Threading; -using System.Threading.Tasks; -using CoreEx.Entities; -using CoreEx.Http; -using CoreEx.Json; -using {{Root.NamespaceCommon}}.Entities; -{{#ifval Root.RefDataCommonNamespace}} -using RefDataNamespace = {{Root.RefDataCommonNamespace}}; -{{/ifval}} +namespace {{Root.NamespaceCommon}}.Agents; -namespace {{Root.NamespaceCommon}}.Agents +/// +/// Provides the {{{EntityNameSeeComments}}} HTTP agent. +/// +public partial class {{Name}}Agent : TypedHttpClientBase<{{Name}}Agent>, I{{Name}}Agent { /// - /// Provides the {{{EntityNameSeeComments}}} HTTP agent. + /// Initializes a new instance of the class. /// - public partial class {{Name}}Agent : TypedHttpClientBase<{{Name}}Agent>, 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) { } + /// The underlying . + /// The optional . + /// The optional . + public {{Name}}Agent(HttpClient client, IJsonSerializer? jsonSerializer = null, CoreEx.ExecutionContext? executionContext = null) : base(client, jsonSerializer, executionContext) { } {{#each WebApiAgentOperations}} - /// - 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); + /// + 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); {{/each}} - } }{{#if Root.PreprocessorDirectives}} #pragma warning restore diff --git a/tools/Beef.CodeGen.Core/Templates/Model_cs.hbs b/tools/Beef.CodeGen.Core/Templates/Model_cs.hbs index b7f61cd92..93c5e5ef8 100644 --- a/tools/Beef.CodeGen.Core/Templates/Model_cs.hbs +++ b/tools/Beef.CodeGen.Core/Templates/Model_cs.hbs @@ -7,48 +7,23 @@ #nullable enable #pragma warning disable -{{/if}} -{{! ===== Using ===== }} -{{#unless Root.IsDataModel}} -using System;{{set-value 'HasUsingStatement' true}} -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Text.Json.Serialization; -using CoreEx.Entities; - {{#ifval RefDataType}} -using CoreEx.RefData; - {{/ifval}} -{{/unless}} -{{#unless Root.IsDataModel}} - {{#if Root.UsingNamespace1}} -using {{Root.UsingNamespace1}};{{set-value 'HasUsingStatement' true}} - {{/if}} - {{#if Root.UsingNamespace2}} -using {{Root.UsingNamespace2}};{{set-value 'HasUsingStatement' true}} - {{/if}} - {{#if Root.UsingNamespace3}} -using {{Root.UsingNamespace3}};{{set-value 'HasUsingStatement' true}} - {{/if}} -{{/unless}} -{{#if HasUsingStatement}} - {{/if}} {{! ===== Class ===== }} -namespace {{#if Root.IsDataModel}}{{Root.NamespaceBusiness}}.Data.Model{{else}}{{#ifeq Root.RuntimeEntityScope 'Common'}}{{Root.NamespaceCommon}}{{else}}{{Root.NamespaceBusiness}}{{/ifeq}}.Entities{{/if}} -{ - /// - /// {{#if Root.IsDataModel}}{{ModelSummaryText}}{{else}}{{#ifeq Root.RuntimeEntityScope 'Common'}}{{sanitize-comments SummaryText}}{{else}}{{SummaryText}}{{/ifeq}}{{/if}} - /// +namespace {{#if Root.IsDataModel}}{{Root.NamespaceBusiness}}.Data.Model{{else}}{{#ifeq Root.RuntimeEntityScope 'Common'}}{{Root.NamespaceCommon}}{{else}}{{Root.NamespaceBusiness}}{{/ifeq}}.Entities{{/if}}; + +/// +/// {{#if Root.IsDataModel}}{{ModelSummaryText}}{{else}}{{#ifeq Root.RuntimeEntityScope 'Common'}}{{sanitize-comments SummaryText}}{{else}}{{SummaryText}}{{/ifeq}}{{/if}} +/// {{#if Root.IsDataModel}} - public {{#if Abstract}}abstract {{/if}}partial class {{{EntityName}}}{{#ifval DataModelInherits}} : {{{DataModelInherits}}}{{/ifval}}{{#ifval ModelImplements}}{{#ifval DataModelInherits}}, {{else}} : {{/ifval}}{{{ModelImplements}}}{{/ifval}}{{#ifval RefDataType}}{{#ifeq CoreProperties.Count 0}} { }{{/ifeq}}{{/ifval}} +public {{#if Abstract}}abstract {{/if}}partial class {{{EntityName}}}{{#ifval DataModelInherits}} : {{{DataModelInherits}}}{{/ifval}}{{#ifval ModelImplements}}{{#ifval DataModelInherits}}, {{else}} : {{/ifval}}{{{ModelImplements}}}{{/ifval}}{{#ifval RefDataType}}{{#ifeq CoreProperties.Count 0}} { }{{/ifeq}}{{/ifval}} {{else}} - public {{#if Abstract}}abstract {{/if}}partial class {{{EntityName}}}{{#ifval ModelInherits}} : {{{ModelInherits}}}{{/ifval}}{{#ifval CommonImplements}}{{#ifval ModelInherits}}, {{else}} : {{/ifval}}{{{CommonImplements}}}{{/ifval}}{{#ifval RefDataType}}{{#ifeq CoreProperties.Count 0}} { }{{/ifeq}}{{/ifval}} +public {{#if Abstract}}abstract {{/if}}partial class {{{EntityName}}}{{#ifval ModelInherits}} : {{{ModelInherits}}}{{/ifval}}{{#ifval CommonImplements}}{{#ifval ModelInherits}}, {{else}} : {{/ifval}}{{{CommonImplements}}}{{/ifval}}{{#ifval RefDataType}}{{#ifeq CoreProperties.Count 0}} { }{{/ifeq}}{{/ifval}} {{/if}} {{#ifnull RefDataType}} - { +{ {{else}} {{#ifne CoreProperties.Count 0}} - { +{ {{/ifne}} {{/ifnull}} {{! ===== Properties ===== }} @@ -61,101 +36,101 @@ namespace {{#if Root.IsDataModel}}{{Root.NamespaceBusiness}}.Data.Model{{else}}{ {{#unless RefDataList}} {{#unless Root.IsDataModel}} {{#ifeq RefDataText 'Optional' 'Always'}} - /// - /// {{#ifeq Root.RuntimeEntityScope 'Common'}}{{sanitize-comments SummaryRefDataText}}{{else}}{{SummaryRefDataText}}{{/ifeq}} - /// + /// + /// {{#ifeq Root.RuntimeEntityScope 'Common'}}{{sanitize-comments SummaryRefDataText}}{{else}}{{SummaryRefDataText}}{{/ifeq}} + /// {{#ifval JsonName}} {{#ifeq Parent.JsonSerializer 'Newtonsoft'}} - [Newtonsoft.Json.JsonProperty("{{#if Root.IsDataModel}}{{JsonDataModelName}}{{else}}{{JsonName}}{{/if}}Text")] + [Newtonsoft.Json.JsonProperty("{{#if Root.IsDataModel}}{{JsonDataModelName}}{{else}}{{JsonName}}{{/if}}Text")] {{/ifeq}} - [JsonPropertyName("{{#if Root.IsDataModel}}{{JsonDataModelName}}{{else}}{{JsonName}}{{/if}}Text")] + [JsonPropertyName("{{#if Root.IsDataModel}}{{JsonDataModelName}}{{else}}{{JsonName}}{{/if}}Text")] {{/ifval}} - public string? {{RefDataTextName}} { get; set; } + public string? {{RefDataTextName}} { get; set; } {{/ifeq}} {{/unless}} {{/unless}} {{/unless}} {{/ifval}} - /// - /// {{#ifeq Root.RuntimeEntityScope 'Common'}}{{sanitize-comments ModelSummaryText}}{{else}}{{ModelSummaryText}}{{/ifeq}} - /// + /// + /// {{#ifeq Root.RuntimeEntityScope 'Common'}}{{sanitize-comments ModelSummaryText}}{{else}}{{ModelSummaryText}}{{/ifeq}} + /// {{#if Root.IsDataModel}} {{#if DataModelSerializationIgnore}} {{#ifeq Parent.JsonSerializer 'Newtonsoft'}} - [Newtonsoft.Json.JsonIgnore] + [Newtonsoft.Json.JsonIgnore] {{/ifeq}} - [JsonIgnore] + [JsonIgnore] {{else}} {{#ifval JsonDataModelName}} {{#ifeq Parent.JsonSerializer 'Newtonsoft'}} - [Newtonsoft.Json.JsonProperty("{{JsonDataModelName}}"{{#if SerializationAlwaysInclude}}, DefaultValueHandling.Include{{/if}})] + [Newtonsoft.Json.JsonProperty("{{JsonDataModelName}}"{{#if SerializationAlwaysInclude}}, DefaultValueHandling.Include{{/if}})] {{/ifeq}} - [JsonPropertyName("{{JsonDataModelName}}")] + [JsonPropertyName("{{JsonDataModelName}}")] {{/ifval}} {{#if SerializationAlwaysInclude}} {{#ifeq Parent.JsonSerializer 'Newtonsoft'}} - [Newtonsoft.Json.JsonIgnore(Condition=JsonIgnoreCondition.Never)] + [Newtonsoft.Json.JsonIgnore(Condition=JsonIgnoreCondition.Never)] {{/ifeq}} - [JsonProperty({{#if SerializationAlwaysInclude}}DefaultValueHandling.Include{{/if}})] + [JsonProperty({{#if SerializationAlwaysInclude}}DefaultValueHandling.Include{{/if}})] {{/if}} {{/if}} {{else}} {{#if SerializationIgnore}} {{#ifeq Parent.JsonSerializer 'Newtonsoft'}} - [Newtonsoft.Json.JsonIgnore] + [Newtonsoft.Json.JsonIgnore] {{/ifeq}} - [JsonIgnore] + [JsonIgnore] {{else}} {{#ifval JsonName}} {{#ifeq Parent.JsonSerializer 'Newtonsoft'}} - [JsonProperty("{{JsonName}}"{{#if SerializationAlwaysInclude}}, DefaultValueHandling.Include{{/if}})] + [JsonProperty("{{JsonName}}"{{#if SerializationAlwaysInclude}}, DefaultValueHandling.Include{{/if}})] {{else}} - [JsonPropertyName("{{JsonName}}")] + [JsonPropertyName("{{JsonName}}")] {{/ifeq}} {{/ifval}} {{#if SerializationAlwaysInclude}} {{#ifeq Parent.JsonSerializer 'Newtonsoft'}} - [JsonProperty({{#if SerializationAlwaysInclude}}DefaultValueHandling.Include{{/if}})] + [JsonProperty({{#if SerializationAlwaysInclude}}DefaultValueHandling.Include{{/if}})] {{/ifeq}} - [JsonIgnore(Condition = JsonIgnoreCondition.Never)] + [JsonIgnore(Condition = JsonIgnoreCondition.Never)] {{/if}} {{/if}} {{/if}} {{#unless Root.IsDataModel}} {{#ifval Annotation1}} - {{Annotation1}} + {{Annotation1}} {{/ifval}} {{#ifval Annotation2}} - {{Annotation2}} + {{Annotation2}} {{/ifval}} {{#ifval Annotation3}} - {{Annotation3}} + {{Annotation3}} {{/ifval}} {{/unless}} - public {{{ModelType}}} {{Name}} { get; set; } + public {{{ModelType}}} {{Name}} { get; set; } {{/each}} {{#unless HasIdentifier}} {{#unless RefDataType}} {{#ifne PrimaryKeyProperties.Count 0}} - /// - /// Creates the primary . - /// - /// The primary . + /// + /// Creates the primary . + /// + /// The primary . {{#each PrimaryKeyProperties}} - /// The {{{PropertyNameSeeComments}}}. + /// The {{{PropertyNameSeeComments}}}. {{/each}} public static CompositeKey CreatePrimaryKey({{#each PrimaryKeyProperties}}{{#unless @first}}, {{/unless}}{{{PrivateType}}} {{ArgumentName}}{{/each}}) => CompositeKey.Create({{#each PrimaryKeyProperties}}{{#unless @first}}, {{/unless}}{{ArgumentName}}{{/each}}); - /// - /// Gets the primary (consists of the following property(s): {{#each PrimaryKeyProperties}}{{#unless @first}}, {{/unless}}{{{PropertyNameSeeComments}}}{{/each}}). - /// + /// + /// Gets the primary (consists of the following property(s): {{#each PrimaryKeyProperties}}{{#unless @first}}, {{/unless}}{{{PropertyNameSeeComments}}}{{/each}}). + /// {{#ifeq JsonSerializer 'Newtonsoft'}} - [Newtonsoft.Json.JsonIgnore] + [Newtonsoft.Json.JsonIgnore] {{/ifeq}} - [JsonIgnore] - public CompositeKey PrimaryKey => CreatePrimaryKey({{#each PrimaryKeyProperties}}{{#unless @first}}, {{/unless}}{{Name}}{{/each}}); + [JsonIgnore] + public CompositeKey PrimaryKey => CreatePrimaryKey({{#each PrimaryKeyProperties}}{{#unless @first}}, {{/unless}}{{Name}}{{/each}}); {{/ifne}} {{/unless}} {{/unless}} @@ -163,70 +138,69 @@ namespace {{#if Root.IsDataModel}}{{Root.NamespaceBusiness}}.Data.Model{{else}}{ {{#unless RefDataType}} {{#ifne PartitionKeyProperties.Count 0}} - /// - /// Creates the . - /// - /// The partition key. + /// + /// Creates the . + /// + /// The partition key. {{#each PartitionKeyProperties}} - /// The {{{PropertyNameSeeComments}}}. + /// The {{{PropertyNameSeeComments}}}. {{/each}} - public static string? CreatePartitionKey({{#each PartitionKeyProperties}}{{#unless @first}}, {{/unless}}{{{PrivateType}}} {{ArgumentName}}{{/each}}) => CompositeKey.Create({{#each PartitionKeyProperties}}{{#unless @first}}, {{/unless}}{{ArgumentName}}{{/each}}).ToString(); + public static string? CreatePartitionKey({{#each PartitionKeyProperties}}{{#unless @first}}, {{/unless}}{{{PrivateType}}} {{ArgumentName}}{{/each}}) => CompositeKey.Create({{#each PartitionKeyProperties}}{{#unless @first}}, {{/unless}}{{ArgumentName}}{{/each}}).ToString(); - /// - /// Gets the Partition Key (consists of the following property(s): {{#each PartitionKeyProperties}}{{#unless @first}}, {{/unless}}{{{PropertyNameSeeComments}}}{{/each}}). - /// + /// + /// Gets the Partition Key (consists of the following property(s): {{#each PartitionKeyProperties}}{{#unless @first}}, {{/unless}}{{{PropertyNameSeeComments}}}{{/each}}). + /// {{#ifeq JsonSerializer 'Newtonsoft'}} - [Newtonsoft.Json.JsonIgnore] + [Newtonsoft.Json.JsonIgnore] {{/ifeq}} - [JsonIgnore] - public string? PartitionKey => CreatePartitionKey({{#each PartitionKeyProperties}}{{#unless @first}}, {{/unless}}{{Name}}{{/each}}); + [JsonIgnore] + public string? PartitionKey => CreatePartitionKey({{#each PartitionKeyProperties}}{{#unless @first}}, {{/unless}}{{Name}}{{/each}}); {{/ifne}} {{/unless}} {{/if}} {{#ifnull RefDataType}} - } +} {{else}} {{#ifne CoreProperties.Count 0}} - } +} {{/ifne}} {{/ifnull}} {{! ===== Collection ===== }} {{#if Collection}} - /// - /// Represents the {{#ifeq Root.RuntimeEntityScope 'Common'}}{{sanitize-comments EntityNameSeeComments}}{{else}}{{EntityNameSeeComments}}{{/ifeq}} collection. - /// - public partial class {{{EntityCollectionName}}} : {{{CollectionInherits}}} { } +/// +/// Represents the {{#ifeq Root.RuntimeEntityScope 'Common'}}{{sanitize-comments EntityNameSeeComments}}{{else}}{{EntityNameSeeComments}}{{/ifeq}} collection. +/// +public partial class {{{EntityCollectionName}}} : {{{CollectionInherits}}} { } {{/if}} {{#if CollectionResult}} {{#unless Root.IsDataModel}} +/// +/// Represents the {{#ifeq Root.RuntimeEntityScope 'Common'}}{{sanitize-comments EntityNameSeeComments}}{{else}}{{EntityNameSeeComments}}{{/ifeq}} collection result. +/// +public class {{{EntityCollectionResultName}}} : {{{CollectionResultInherits}}} +{ /// - /// Represents the {{#ifeq Root.RuntimeEntityScope 'Common'}}{{sanitize-comments EntityNameSeeComments}}{{else}}{{EntityNameSeeComments}}{{/ifeq}} collection result. + /// Initializes a new instance of the {{{see-comments EntityCollectionResultName}}} class. /// - public class {{{EntityCollectionResultName}}} : {{{CollectionResultInherits}}} - { - /// - /// Initializes a new instance of the {{{see-comments EntityCollectionResultName}}} class. - /// - public {{{EntityCollectionResultName}}}() { } - - /// - /// Initializes a new instance of the {{{see-comments EntityCollectionResultName}}} class with . - /// - /// The . - public {{{EntityCollectionResultName}}}(PagingArgs? paging) : base(paging) { } - - /// - /// Initializes a new instance of the {{{see-comments EntityCollectionResultName}}} class with to add. - /// - /// The items to add. - /// The . - public {{{EntityCollectionResultName}}}(IEnumerable<{{{EntityName}}}> items, PagingArgs? paging = null) : base(paging) => Items.AddRange(items); - } + public {{{EntityCollectionResultName}}}() { } + + /// + /// Initializes a new instance of the {{{see-comments EntityCollectionResultName}}} class with . + /// + /// The . + public {{{EntityCollectionResultName}}}(PagingArgs? paging) : base(paging) { } + + /// + /// Initializes a new instance of the {{{see-comments EntityCollectionResultName}}} class with to add. + /// + /// The items to add. + /// The . + public {{{EntityCollectionResultName}}}(IEnumerable<{{{EntityName}}}> items, PagingArgs? paging = null) : base(paging) => Items.AddRange(items); +} {{/unless}} -{{/if}} -}{{#if Root.PreprocessorDirectives}} +{{/if}}{{#if Root.PreprocessorDirectives}} #pragma warning restore #nullable restore{{/if}} \ No newline at end of file diff --git a/tools/Beef.CodeGen.Core/Templates/ReferenceDataIWebApiAgent_cs.hbs b/tools/Beef.CodeGen.Core/Templates/ReferenceDataIWebApiAgent_cs.hbs index 2e434aaab..7987a8633 100644 --- a/tools/Beef.CodeGen.Core/Templates/ReferenceDataIWebApiAgent_cs.hbs +++ b/tools/Beef.CodeGen.Core/Templates/ReferenceDataIWebApiAgent_cs.hbs @@ -7,50 +7,33 @@ #pragma warning disable {{/if}} -using System; -using System.Collections.Generic; -using System.Net.Http; -using System.Threading; -using System.Threading.Tasks; -using CoreEx.Configuration; -using CoreEx.Entities; -using CoreEx.Http; -using CoreEx.Json; -using CoreEx.RefData; -using Microsoft.Extensions.Logging; -using {{Root.NamespaceCommon}}.Entities; -{{#ifval Root.RefDataCommonNamespace}} -using RefDataNamespace = {{Root.RefDataCommonNamespace}}; -{{/ifval}} +namespace {{Root.NamespaceCommon}}.Agents; -namespace {{Root.NamespaceCommon}}.Agents +/// +/// Defines the ReferenceData HTTP agent. +/// +public partial interface IReferenceDataAgent { +{{#each RefDataEntities}} /// - /// Defines the ReferenceData HTTP agent. + /// Gets all of the {{see-comments RefDataQualifiedEntityName}} items that match the filter arguments. /// - public partial interface IReferenceDataAgent - { -{{#each RefDataEntities}} - /// - /// Gets all of the {{see-comments RefDataQualifiedEntityName}} items that match the filter arguments. - /// - /// The optional arguments. - /// The optional . - /// The . - /// A . - Task> {{Name}}GetAllAsync(ReferenceDataFilter? args = null, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); + /// The optional arguments. + /// The optional . + /// The . + /// A . + Task> {{Name}}GetAllAsync(ReferenceDataFilter? args = null, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); {{/each}} - /// - /// Gets the reference data entries for the specified entities and codes from the query string; e.g: {{RefDataWebApiRoute}}?entity=codeX,codeY&entity2=codeZ&entity3 - /// - /// The optional list of reference data names. - /// The optional . - /// The . - /// A . - /// The reference data objects will need to be manually extracted from the corresponding response content. - Task GetNamedAsync(string[] names, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); - } + /// + /// Gets the reference data entries for the specified entities and codes from the query string; e.g: {{RefDataWebApiRoute}}?entity=codeX,codeY&entity2=codeZ&entity3 + /// + /// The optional list of reference data names. + /// The optional . + /// The . + /// A . + /// The reference data objects will need to be manually extracted from the corresponding response content. + Task GetNamedAsync(string[] names, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default); }{{#if Root.PreprocessorDirectives}} #pragma warning restore diff --git a/tools/Beef.CodeGen.Core/Templates/ReferenceDataWebApiAgent_cs.hbs b/tools/Beef.CodeGen.Core/Templates/ReferenceDataWebApiAgent_cs.hbs index fb1de3a71..d18de2faa 100644 --- a/tools/Beef.CodeGen.Core/Templates/ReferenceDataWebApiAgent_cs.hbs +++ b/tools/Beef.CodeGen.Core/Templates/ReferenceDataWebApiAgent_cs.hbs @@ -7,50 +7,35 @@ #pragma warning disable {{/if}} -using System; -using System.Collections.Generic; -using System.Net.Http; -using System.Threading; -using System.Threading.Tasks; -using CoreEx.Entities; -using CoreEx.Http; -using CoreEx.Json; -using CoreEx.RefData; -using {{Root.NamespaceCommon}}.Entities; -{{#ifval Root.RefDataCommonNamespace}} -using RefDataNamespace = {{Root.RefDataCommonNamespace}}; -{{/ifval}} +namespace {{Root.NamespaceCommon}}.Agents; -namespace {{Root.NamespaceCommon}}.Agents +/// +/// Provides the ReferenceData HTTP agent. +/// +public partial class ReferenceDataAgent : TypedHttpClientBase, IReferenceDataAgent { /// - /// Provides the ReferenceData HTTP agent. + /// Initializes a new instance of the class. /// - public partial class ReferenceDataAgent : TypedHttpClientBase, 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) { } + /// 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); + /// + public Task> {{Name}}GetAllAsync(ReferenceDataFilter? args = null, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) + => GetAsync<{{RefDataQualifiedEntityCollectionName}}>("{{WebApiRoutePrefix}}", requestOptions: requestOptions, args: HttpArgs.Create(new HttpArg("args", args!, HttpArgType.FromUriUseProperties)), cancellationToken); {{/each}} - /// - public Task GetNamedAsync(string[] names, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) - { - var ro = requestOptions ?? new HttpRequestOptions(); - if (names != null) - ro.UrlQueryString += string.Join("&", names); - - return GetAsync("{{Root.RefDataWebApiRoute}}", ro, null, cancellationToken); - } + /// + public Task GetNamedAsync(string[] names, HttpRequestOptions? requestOptions = null, CancellationToken cancellationToken = default) + { + var ro = requestOptions ?? new HttpRequestOptions(); + if (names != null) + ro.UrlQueryString += string.Join("&", names); + + return GetAsync("{{Root.RefDataWebApiRoute}}", ro, null, cancellationToken); } }{{#if Root.PreprocessorDirectives}}