diff --git a/Beef.sln b/Beef.sln
index 3bf331eac..e1d899244 100644
--- a/Beef.sln
+++ b/Beef.sln
@@ -113,7 +113,38 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Beef.Demo.Abc.Database", "s
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Grpc", "Grpc", "{3C2DB788-C4D6-48E7-9E26-9563B1C59EB5}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Beef.Grpc", "src\Beef.Grpc\Beef.Grpc.csproj", "{2AD5436B-10AB-4312-AD25-A9EB70E0C92D}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Beef.Grpc", "src\Beef.Grpc\Beef.Grpc.csproj", "{2AD5436B-10AB-4312-AD25-A9EB70E0C92D}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "My.Hr", "My.Hr", "{FEA11C67-E7C7-49BC-99F5-5E5BF8F8674F}"
+ ProjectSection(SolutionItems) = preProject
+ samples\My.Hr\README.md = samples\My.Hr\README.md
+ EndProjectSection
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Testing", "Testing", "{00C76124-DB2C-4653-B8C1-F7260784EA5A}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tools", "Tools", "{BFA3B544-8437-4158-A98F-84491B12F472}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "My.Hr.CodeGen", "samples\My.Hr\My.Hr.CodeGen\My.Hr.CodeGen.csproj", "{E773F133-A920-49A9-96BD-F7BD73A63D0C}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "My.Hr.Database", "samples\My.Hr\My.Hr.Database\My.Hr.Database.csproj", "{9DEA75E3-5F77-40F5-B8E1-CB5028C41D9F}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "My.Hr.Api", "samples\My.Hr\My.Hr.Api\My.Hr.Api.csproj", "{B7D52220-ABD0-40B7-9D23-E51B344D97B8}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "My.Hr.Business", "samples\My.Hr\My.Hr.Business\My.Hr.Business.csproj", "{BD7BDE9B-7F1A-484A-95C3-A5ACCA2A2DA8}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "My.Hr.Common", "samples\My.Hr\My.Hr.Common\My.Hr.Common.csproj", "{F962F1CC-DA7C-4146-8D36-0E6C74C261E5}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "My.Hr.Test", "samples\My.Hr\My.Hr.Test\My.Hr.Test.csproj", "{54B168EB-C74D-4588-9D9E-BDD386D84C1F}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "docs", "docs", "{2429F084-A3F8-4F8A-88FF-E3BF5B210C13}"
+ ProjectSection(SolutionItems) = preProject
+ samples\My.Hr\docs\Employee-Api.md = samples\My.Hr\docs\Employee-Api.md
+ samples\My.Hr\docs\Employee-DB.md = samples\My.Hr\docs\Employee-DB.md
+ samples\My.Hr\docs\Employee-Search.md = samples\My.Hr\docs\Employee-Search.md
+ samples\My.Hr\docs\Employee-Terminate.md = samples\My.Hr\docs\Employee-Terminate.md
+ samples\My.Hr\docs\Employee-Test.md = samples\My.Hr\docs\Employee-Test.md
+ samples\My.Hr\docs\Performance-Review.md = samples\My.Hr\docs\Performance-Review.md
+ EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -245,6 +276,30 @@ Global
{2AD5436B-10AB-4312-AD25-A9EB70E0C92D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2AD5436B-10AB-4312-AD25-A9EB70E0C92D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2AD5436B-10AB-4312-AD25-A9EB70E0C92D}.Release|Any CPU.Build.0 = Release|Any CPU
+ {E773F133-A920-49A9-96BD-F7BD73A63D0C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {E773F133-A920-49A9-96BD-F7BD73A63D0C}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {E773F133-A920-49A9-96BD-F7BD73A63D0C}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {E773F133-A920-49A9-96BD-F7BD73A63D0C}.Release|Any CPU.Build.0 = Release|Any CPU
+ {9DEA75E3-5F77-40F5-B8E1-CB5028C41D9F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {9DEA75E3-5F77-40F5-B8E1-CB5028C41D9F}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {9DEA75E3-5F77-40F5-B8E1-CB5028C41D9F}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {9DEA75E3-5F77-40F5-B8E1-CB5028C41D9F}.Release|Any CPU.Build.0 = Release|Any CPU
+ {B7D52220-ABD0-40B7-9D23-E51B344D97B8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {B7D52220-ABD0-40B7-9D23-E51B344D97B8}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {B7D52220-ABD0-40B7-9D23-E51B344D97B8}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {B7D52220-ABD0-40B7-9D23-E51B344D97B8}.Release|Any CPU.Build.0 = Release|Any CPU
+ {BD7BDE9B-7F1A-484A-95C3-A5ACCA2A2DA8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {BD7BDE9B-7F1A-484A-95C3-A5ACCA2A2DA8}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {BD7BDE9B-7F1A-484A-95C3-A5ACCA2A2DA8}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {BD7BDE9B-7F1A-484A-95C3-A5ACCA2A2DA8}.Release|Any CPU.Build.0 = Release|Any CPU
+ {F962F1CC-DA7C-4146-8D36-0E6C74C261E5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {F962F1CC-DA7C-4146-8D36-0E6C74C261E5}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {F962F1CC-DA7C-4146-8D36-0E6C74C261E5}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {F962F1CC-DA7C-4146-8D36-0E6C74C261E5}.Release|Any CPU.Build.0 = Release|Any CPU
+ {54B168EB-C74D-4588-9D9E-BDD386D84C1F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {54B168EB-C74D-4588-9D9E-BDD386D84C1F}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {54B168EB-C74D-4588-9D9E-BDD386D84C1F}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {54B168EB-C74D-4588-9D9E-BDD386D84C1F}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -293,6 +348,16 @@ Global
{5D6F532E-7DAC-40B3-8A65-D557B34C3605} = {104CA8C9-84F6-4B5C-9576-F25ADA255CF0}
{3C2DB788-C4D6-48E7-9E26-9563B1C59EB5} = {6C902314-82BD-48FD-8777-5C3AC986E4D3}
{2AD5436B-10AB-4312-AD25-A9EB70E0C92D} = {3C2DB788-C4D6-48E7-9E26-9563B1C59EB5}
+ {FEA11C67-E7C7-49BC-99F5-5E5BF8F8674F} = {2CD70532-8E64-46DF-A895-B41234BAC290}
+ {00C76124-DB2C-4653-B8C1-F7260784EA5A} = {FEA11C67-E7C7-49BC-99F5-5E5BF8F8674F}
+ {BFA3B544-8437-4158-A98F-84491B12F472} = {FEA11C67-E7C7-49BC-99F5-5E5BF8F8674F}
+ {E773F133-A920-49A9-96BD-F7BD73A63D0C} = {BFA3B544-8437-4158-A98F-84491B12F472}
+ {9DEA75E3-5F77-40F5-B8E1-CB5028C41D9F} = {BFA3B544-8437-4158-A98F-84491B12F472}
+ {B7D52220-ABD0-40B7-9D23-E51B344D97B8} = {FEA11C67-E7C7-49BC-99F5-5E5BF8F8674F}
+ {BD7BDE9B-7F1A-484A-95C3-A5ACCA2A2DA8} = {FEA11C67-E7C7-49BC-99F5-5E5BF8F8674F}
+ {F962F1CC-DA7C-4146-8D36-0E6C74C261E5} = {FEA11C67-E7C7-49BC-99F5-5E5BF8F8674F}
+ {54B168EB-C74D-4588-9D9E-BDD386D84C1F} = {00C76124-DB2C-4653-B8C1-F7260784EA5A}
+ {2429F084-A3F8-4F8A-88FF-E3BF5B210C13} = {FEA11C67-E7C7-49BC-99F5-5E5BF8F8674F}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {42D71086-61E6-4D31-B4B8-BFC8CC471428}
diff --git a/README.md b/README.md
index 55ccd42ea..729708978 100644
--- a/README.md
+++ b/README.md
@@ -156,6 +156,7 @@ The following samples are provided to guide usage:
Sample | Description
-|-
+[`My.Hr`](./samples/My.Hr) | A sample as an end-to-end solution walkthrough to demonstrate the usage of _Beef_ within the context of a fictitious Human Resources solution. The main intent is to show how _Beef_ can be used against a relational database (SQL Server) leveraging both direct ADO.NET (with stored procedures) and Entity Framework (EF) where applicable.
[`Cdr.Banking`](./samples/Cdr.Banking) | A sample as an end-to-end solution to demonstrate _Beef_ being used to solve a real-world scenario. This demonstrates an implementation of the [CDR](https://consumerdatastandards.org.au/) [Banking](https://consumerdatastandardsaustralia.github.io/standards/#consumer-data-standards-banking-apis) APIs leveraging a Cosmos DB data source.
[`Demo`](./samples/Demo) | A sample as an end-to-end solution to demonstrate the tiering & layering, code-generation, database management and automated intra-domain integration testing. This is primarily used to further test the key end-to-end capabilities enabled by _Beef_.
@@ -219,11 +220,16 @@ _Beef_ is open source under the [MIT license](./LICENSE) and is free for commerc
To start using _Beef_ you do not need to clone or fork the repo; you just need to create a solution with the underlying projects using the prescribed [solution structure](./docs/Solution-Structure.md), including referencing the appropriate [NuGet packages](#Framework). To accelerate this a .NET Core [template capability](./templates/Beef.Template.Solution/README.md) is provided to enable you to get up and running in minutes.
-See the following for example end-to-end usage; each demonstrating the same API functionality leveraging different data sources to accomplish:
+See the following for example end-to-end solution/project creation; each demonstrating the same API functionality leveraging different data sources to accomplish:
- [Cosmos sample](./docs/Sample-Cosmos-GettingStarted.md)
- [Database Stored Procedures sample](./docs/Sample-StoredProcs-GettingStarted.md)
- [Database Entity Framework sample](./docs/Sample-EntityFramework-GettingStarted.md)
+Otherwise, follow along with the following sample tutorials that will provide a more in-depth walkthrough solving a defined functional problem:
+
+- [`My.Hr`](./samples/My.Hr)
+- [`Cdr.Banking`](./samples/Cdr.Banking)
+
## Contributing
diff --git a/samples/Cdr.Banking/Cdr.Banking.Api/Controllers/Generated/AccountController.cs b/samples/Cdr.Banking/Cdr.Banking.Api/Controllers/Generated/AccountController.cs
index 56eaf8bb7..17a759345 100644
--- a/samples/Cdr.Banking/Cdr.Banking.Api/Controllers/Generated/AccountController.cs
+++ b/samples/Cdr.Banking/Cdr.Banking.Api/Controllers/Generated/AccountController.cs
@@ -21,28 +21,32 @@
namespace Cdr.Banking.Api.Controllers
{
///
- /// Provides the Account Web API functionality.
+ /// Provides the Web API functionality.
///
+ [AllowAnonymous]
[Route("api/v1/banking/accounts")]
public partial class AccountController : ControllerBase
{
private readonly IAccountManager _manager;
-
+
///
/// Initializes a new instance of the class.
///
/// The .
- public AccountController(IAccountManager manager) => _manager = Check.NotNull(manager, nameof(manager));
+ public AccountController(IAccountManager manager)
+ { _manager = Check.NotNull(manager, nameof(manager)); AccountControllerCtor(); }
+
+ partial void AccountControllerCtor(); // Enables additional functionality to be added to the constructor.
///
/// Get all accounts.
///
/// The Product Category (see ).
/// The Open Status (see ).
- /// The Is Owned.
- /// A .
- [HttpGet()]
- [Route("")]
+ /// Indicates whether Is Owned.
+ /// The
+ [AllowAnonymous]
+ [HttpGet("")]
[ProducesResponseType(typeof(AccountCollection), (int)HttpStatusCode.OK)]
[ProducesResponseType((int)HttpStatusCode.NoContent)]
public IActionResult GetAccounts([FromQuery(Name = "product-category")] string? productCategory = default, [FromQuery(Name = "open-status")] string? openStatus = default, [FromQuery(Name = "is-owned")] bool? isOwned = default)
@@ -56,9 +60,9 @@ public IActionResult GetAccounts([FromQuery(Name = "product-category")] string?
/// Get .
///
/// The identifier.
- /// The selected entity where found.
- [HttpGet()]
- [Route("{accountId}")]
+ /// The selected where found.
+ [AllowAnonymous]
+ [HttpGet("{accountId}")]
[ProducesResponseType(typeof(AccountDetail), (int)HttpStatusCode.OK)]
[ProducesResponseType((int)HttpStatusCode.NotFound)]
public IActionResult GetDetail(string? accountId)
@@ -71,9 +75,9 @@ public IActionResult GetDetail(string? accountId)
/// Get .
///
/// The identifier.
- /// The selected entity where found.
- [HttpGet()]
- [Route("{accountId}/balance")]
+ /// The selected where found.
+ [AllowAnonymous]
+ [HttpGet("{accountId}/balance")]
[ProducesResponseType(typeof(Balance), (int)HttpStatusCode.OK)]
[ProducesResponseType((int)HttpStatusCode.NotFound)]
public IActionResult GetBalance(string? accountId)
diff --git a/samples/Cdr.Banking/Cdr.Banking.Api/Controllers/Generated/ReferenceDataController.cs b/samples/Cdr.Banking/Cdr.Banking.Api/Controllers/Generated/ReferenceDataController.cs
index 01659da04..0abda80b9 100644
--- a/samples/Cdr.Banking/Cdr.Banking.Api/Controllers/Generated/ReferenceDataController.cs
+++ b/samples/Cdr.Banking/Cdr.Banking.Api/Controllers/Generated/ReferenceDataController.cs
@@ -24,14 +24,16 @@ namespace Cdr.Banking.Api.Controllers
///
/// Provides the ReferenceData Web API functionality.
///
+ [AllowAnonymous]
public partial class ReferenceDataController : ControllerBase
{
///
- /// Gets all of the reference data entities that match the specified criteria.
+ /// Gets all of the reference data items that match the specified criteria.
///
/// The reference data code list.
/// The reference data text (including wildcards).
- /// A collection.
+ /// A RefDataNamespace.OpenStatus collection.
+ [AllowAnonymous]
[HttpGet()]
[Route("api/v1/ref/openStatuses")]
[ProducesResponseType(typeof(IEnumerable), (int)HttpStatusCode.OK)]
@@ -41,11 +43,12 @@ public partial class ReferenceDataController : ControllerBase
operationType: OperationType.Read, statusCode: HttpStatusCode.OK, alternateStatusCode: HttpStatusCode.NoContent);
///
- /// Gets all of the reference data entities that match the specified criteria.
+ /// Gets all of the reference data items that match the specified criteria.
///
/// The reference data code list.
/// The reference data text (including wildcards).
- /// A collection.
+ /// A RefDataNamespace.ProductCategory collection.
+ [AllowAnonymous]
[HttpGet()]
[Route("api/v1/ref/productCategories")]
[ProducesResponseType(typeof(IEnumerable), (int)HttpStatusCode.OK)]
@@ -55,11 +58,12 @@ public partial class ReferenceDataController : ControllerBase
operationType: OperationType.Read, statusCode: HttpStatusCode.OK, alternateStatusCode: HttpStatusCode.NoContent);
///
- /// Gets all of the reference data entities that match the specified criteria.
+ /// Gets all of the reference data items that match the specified criteria.
///
/// The reference data code list.
/// The reference data text (including wildcards).
- /// A collection.
+ /// A RefDataNamespace.AccountUType collection.
+ [AllowAnonymous]
[HttpGet()]
[Route("api/v1/ref/accountUTypes")]
[ProducesResponseType(typeof(IEnumerable), (int)HttpStatusCode.OK)]
@@ -69,11 +73,12 @@ public partial class ReferenceDataController : ControllerBase
operationType: OperationType.Read, statusCode: HttpStatusCode.OK, alternateStatusCode: HttpStatusCode.NoContent);
///
- /// Gets all of the reference data entities that match the specified criteria.
+ /// Gets all of the reference data items that match the specified criteria.
///
/// The reference data code list.
/// The reference data text (including wildcards).
- /// A collection.
+ /// A RefDataNamespace.MaturityInstructions collection.
+ [AllowAnonymous]
[HttpGet()]
[Route("api/v1/ref/maturityInstructions")]
[ProducesResponseType(typeof(IEnumerable), (int)HttpStatusCode.OK)]
@@ -83,11 +88,12 @@ public partial class ReferenceDataController : ControllerBase
operationType: OperationType.Read, statusCode: HttpStatusCode.OK, alternateStatusCode: HttpStatusCode.NoContent);
///
- /// Gets all of the reference data entities that match the specified criteria.
+ /// Gets all of the reference data items that match the specified criteria.
///
/// The reference data code list.
/// The reference data text (including wildcards).
- /// A collection.
+ /// A RefDataNamespace.TransactionType collection.
+ [AllowAnonymous]
[HttpGet()]
[Route("api/v1/ref/transactionTypes")]
[ProducesResponseType(typeof(IEnumerable), (int)HttpStatusCode.OK)]
@@ -97,11 +103,12 @@ public partial class ReferenceDataController : ControllerBase
operationType: OperationType.Read, statusCode: HttpStatusCode.OK, alternateStatusCode: HttpStatusCode.NoContent);
///
- /// Gets all of the reference data entities that match the specified criteria.
+ /// Gets all of the reference data items that match the specified criteria.
///
/// The reference data code list.
/// The reference data text (including wildcards).
- /// A collection.
+ /// A RefDataNamespace.TransactionStatus collection.
+ [AllowAnonymous]
[HttpGet()]
[Route("api/v1/ref/transactionStatuses")]
[ProducesResponseType(typeof(IEnumerable), (int)HttpStatusCode.OK)]
@@ -111,9 +118,10 @@ public partial class ReferenceDataController : ControllerBase
operationType: OperationType.Read, statusCode: HttpStatusCode.OK, alternateStatusCode: HttpStatusCode.NoContent);
///
- /// 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
+ /// Gets the reference data entries for the specified entities and codes from the query string; e.g: ?entity=codeX,codeY&entity2=codeZ&entity3
///
/// A .
+ [AllowAnonymous]
[HttpGet()]
[Route("api/v1/ref")]
[ProducesResponseType(typeof(ReferenceDataMultiCollection), (int)HttpStatusCode.OK)]
diff --git a/samples/Cdr.Banking/Cdr.Banking.Api/Controllers/Generated/TransactionController.cs b/samples/Cdr.Banking/Cdr.Banking.Api/Controllers/Generated/TransactionController.cs
index 0646d741c..104058bf2 100644
--- a/samples/Cdr.Banking/Cdr.Banking.Api/Controllers/Generated/TransactionController.cs
+++ b/samples/Cdr.Banking/Cdr.Banking.Api/Controllers/Generated/TransactionController.cs
@@ -21,18 +21,22 @@
namespace Cdr.Banking.Api.Controllers
{
///
- /// Provides the Transaction Web API functionality.
+ /// Provides the Web API functionality.
///
+ [AllowAnonymous]
[Route("api/v1/banking/accounts")]
public partial class TransactionController : ControllerBase
{
private readonly ITransactionManager _manager;
-
+
///
/// Initializes a new instance of the class.
///
/// The .
- public TransactionController(ITransactionManager manager) => _manager = Check.NotNull(manager, nameof(manager));
+ public TransactionController(ITransactionManager manager)
+ { _manager = Check.NotNull(manager, nameof(manager)); TransactionControllerCtor(); }
+
+ partial void TransactionControllerCtor(); // Enables additional functionality to be added to the constructor.
///
/// Get transaction for account.
@@ -43,9 +47,9 @@ public partial class TransactionController : ControllerBase
/// The Min Amount.
/// The Max Amount.
/// The Text.
- /// A .
- [HttpGet()]
- [Route("{accountId}/transactions")]
+ /// The
+ [AllowAnonymous]
+ [HttpGet("{accountId}/transactions")]
[ProducesResponseType(typeof(TransactionCollection), (int)HttpStatusCode.OK)]
[ProducesResponseType((int)HttpStatusCode.NoContent)]
public IActionResult GetTransactions([FromRoute] string? accountId, [FromQuery(Name = "oldest-time")] DateTime? fromDate = default, [FromQuery(Name = "newest-time")] DateTime? toDate = default, [FromQuery(Name = "min-amount")] decimal? minAmount = default, [FromQuery(Name = "max-amount")] decimal? maxAmount = default, string? text = default)
diff --git a/samples/Cdr.Banking/Cdr.Banking.Business/Data/Generated/AccountData.cs b/samples/Cdr.Banking/Cdr.Banking.Business/Data/Generated/AccountData.cs
index 91bd3ef44..d8309cffa 100644
--- a/samples/Cdr.Banking/Cdr.Banking.Business/Data/Generated/AccountData.cs
+++ b/samples/Cdr.Banking/Cdr.Banking.Business/Data/Generated/AccountData.cs
@@ -10,9 +10,9 @@
using System.Linq;
using System.Text;
using System.Threading.Tasks;
+using Microsoft.Azure.Cosmos;
using Beef;
using Beef.Business;
-using Microsoft.Azure.Cosmos;
using Beef.Data.Cosmos;
using Beef.Entities;
using Beef.Mapper;
@@ -23,7 +23,7 @@
namespace Cdr.Banking.Business.Data
{
///
- /// Provides the Account data access.
+ /// Provides the data access.
///
[System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1052:Static holder types should be Static or NotInheritable", Justification = "Will not always appear static depending on code-gen options")]
public partial class AccountData : IAccountData
@@ -43,19 +43,17 @@ public partial class AccountData : IAccountData
/// Initializes a new instance of the class.
///
/// The .
- public AccountData(ICosmosDb cosmos) { _cosmos = Check.NotNull(cosmos, nameof(cosmos)); AccountDataCtor(); }
+ public AccountData(ICosmosDb cosmos)
+ { _cosmos = Check.NotNull(cosmos, nameof(cosmos)); AccountDataCtor(); }
- ///
- /// Enables additional functionality to be added to the constructor.
- ///
- partial void AccountDataCtor();
+ partial void AccountDataCtor(); // Enables additional functionality to be added to the constructor.
///
/// Get all accounts.
///
- /// The Args (see ).
+ /// The Args (see ).
/// The .
- /// A .
+ /// The .
public Task GetAccountsAsync(AccountArgs? args, PagingArgs? paging)
{
return DataInvoker.Current.InvokeAsync(this, async () =>
@@ -71,7 +69,7 @@ public Task GetAccountsAsync(AccountArgs? args, PagingA
/// Get .
///
/// The identifier.
- /// The selected object where found; otherwise, null.
+ /// The selected where found.
public Task GetDetailAsync(string? accountId)
{
return DataInvoker.Current.InvokeAsync(this, async () =>
@@ -85,14 +83,12 @@ public Task GetAccountsAsync(AccountArgs? args, PagingA
/// Get .
///
/// The identifier.
- /// The selected object where found; otherwise, null.
+ /// The selected where found.
public Task GetBalanceAsync(string? accountId)
- {
- return DataInvoker.Current.InvokeAsync(this, () => GetBalanceOnImplementationAsync(accountId));
- }
+ => DataInvoker.Current.InvokeAsync(this, () => GetBalanceOnImplementationAsync(accountId));
///
- /// Provides the entity and Cosmos property mapping.
+ /// Provides the and Cosmos property mapping.
///
[System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1034:Nested types should not be visible", Justification = "By design; as there is a direct relationship")]
public partial class CosmosMapper : CosmosDbMapper
@@ -102,7 +98,7 @@ public partial class CosmosMapper : CosmosDbMapper
public CosmosMapper()
{
- Property(s => s.Id, d => d.Id).SetUniqueKey(true);
+ Property(s => s.Id, d => d.Id).SetUniqueKey(false);
Property(s => s.CreationDate, d => d.CreationDate);
Property(s => s.DisplayName, d => d.DisplayName);
Property(s => s.Nickname, d => d.Nickname);
@@ -115,10 +111,7 @@ public CosmosMapper()
CosmosMapperCtor();
}
- ///
- /// Enables the constructor to be extended.
- ///
- partial void CosmosMapperCtor();
+ partial void CosmosMapperCtor(); // Enables the CosmosMapper constructor to be extended.
}
}
}
diff --git a/samples/Cdr.Banking/Cdr.Banking.Business/Data/Generated/AccountDetailData.cs b/samples/Cdr.Banking/Cdr.Banking.Business/Data/Generated/AccountDetailData.cs
index 38266fe9d..bd06ddf82 100644
--- a/samples/Cdr.Banking/Cdr.Banking.Business/Data/Generated/AccountDetailData.cs
+++ b/samples/Cdr.Banking/Cdr.Banking.Business/Data/Generated/AccountDetailData.cs
@@ -10,9 +10,9 @@
using System.Linq;
using System.Text;
using System.Threading.Tasks;
+using Microsoft.Azure.Cosmos;
using Beef;
using Beef.Business;
-using Microsoft.Azure.Cosmos;
using Beef.Data.Cosmos;
using Beef.Entities;
using Beef.Mapper;
@@ -23,13 +23,14 @@
namespace Cdr.Banking.Business.Data
{
///
- /// Provides the Detail data access.
+ /// Provides the data access.
///
[System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1052:Static holder types should be Static or NotInheritable", Justification = "Will not always appear static depending on code-gen options")]
public partial class AccountDetailData
{
+
///
- /// Provides the entity and Cosmos property mapping.
+ /// Provides the and Cosmos property mapping.
///
[System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1034:Nested types should not be visible", Justification = "By design; as there is a direct relationship")]
public partial class CosmosMapper : CosmosDbMapper
@@ -50,10 +51,7 @@ public CosmosMapper()
CosmosMapperCtor();
}
- ///
- /// Enables the constructor to be extended.
- ///
- partial void CosmosMapperCtor();
+ partial void CosmosMapperCtor(); // Enables the CosmosMapper constructor to be extended.
}
}
}
diff --git a/samples/Cdr.Banking/Cdr.Banking.Business/Data/Generated/IAccountData.cs b/samples/Cdr.Banking/Cdr.Banking.Business/Data/Generated/IAccountData.cs
index 005b65ab6..38ba8c4a5 100644
--- a/samples/Cdr.Banking/Cdr.Banking.Business/Data/Generated/IAccountData.cs
+++ b/samples/Cdr.Banking/Cdr.Banking.Business/Data/Generated/IAccountData.cs
@@ -17,30 +17,30 @@
namespace Cdr.Banking.Business.Data
{
///
- /// Defines the Account data access.
+ /// Defines the data access.
///
public partial interface IAccountData
{
///
/// Get all accounts.
///
- /// The Args (see ).
+ /// The Args (see ).
/// The .
- /// A .
+ /// The .
Task GetAccountsAsync(AccountArgs? args, PagingArgs? paging);
///
/// Get .
///
/// The identifier.
- /// The selected object where found; otherwise, null.
+ /// The selected where found.
Task GetDetailAsync(string? accountId);
///
/// Get .
///
/// The identifier.
- /// The selected object where found; otherwise, null.
+ /// The selected where found.
Task GetBalanceAsync(string? accountId);
}
}
diff --git a/samples/Cdr.Banking/Cdr.Banking.Business/Data/Generated/IReferenceDataData.cs b/samples/Cdr.Banking/Cdr.Banking.Business/Data/Generated/IReferenceDataData.cs
index ac0b9f8d2..e66e6945a 100644
--- a/samples/Cdr.Banking/Cdr.Banking.Business/Data/Generated/IReferenceDataData.cs
+++ b/samples/Cdr.Banking/Cdr.Banking.Business/Data/Generated/IReferenceDataData.cs
@@ -15,44 +15,44 @@
namespace Cdr.Banking.Business.Data
{
///
- /// Provides the database access.
+ /// Provides the ReferenceData data access.
///
public partial interface IReferenceDataData
{
///
- /// Gets all the objects.
+ /// Gets all the items.
///
- /// A .
+ /// The .
Task OpenStatusGetAllAsync();
///
- /// Gets all the objects.
+ /// Gets all the items.
///
- /// A .
+ /// The .
Task ProductCategoryGetAllAsync();
///
- /// Gets all the objects.
+ /// Gets all the items.
///
- /// A .
+ /// The .
Task AccountUTypeGetAllAsync();
///
- /// Gets all the objects.
+ /// Gets all the items.
///
- /// A .
+ /// The .
Task MaturityInstructionsGetAllAsync();
///
- /// Gets all the objects.
+ /// Gets all the items.
///
- /// A .
+ /// The .
Task TransactionTypeGetAllAsync();
///
- /// Gets all the objects.
+ /// Gets all the items.
///
- /// A .
+ /// The .
Task TransactionStatusGetAllAsync();
}
}
diff --git a/samples/Cdr.Banking/Cdr.Banking.Business/Data/Generated/ITransactionData.cs b/samples/Cdr.Banking/Cdr.Banking.Business/Data/Generated/ITransactionData.cs
index eddf0f644..595968742 100644
--- a/samples/Cdr.Banking/Cdr.Banking.Business/Data/Generated/ITransactionData.cs
+++ b/samples/Cdr.Banking/Cdr.Banking.Business/Data/Generated/ITransactionData.cs
@@ -17,7 +17,7 @@
namespace Cdr.Banking.Business.Data
{
///
- /// Defines the Transaction data access.
+ /// Defines the data access.
///
public partial interface ITransactionData
{
@@ -25,9 +25,9 @@ public partial interface ITransactionData
/// Get transaction for account.
///
/// The Account Id.
- /// The Args (see ).
+ /// The Args (see ).
/// The .
- /// A .
+ /// The .
Task GetTransactionsAsync(string? accountId, TransactionArgs? args, PagingArgs? paging);
}
}
diff --git a/samples/Cdr.Banking/Cdr.Banking.Business/Data/Generated/ReferenceDataData.cs b/samples/Cdr.Banking/Cdr.Banking.Business/Data/Generated/ReferenceDataData.cs
index 02567bb8b..bb5ea36dd 100644
--- a/samples/Cdr.Banking/Cdr.Banking.Business/Data/Generated/ReferenceDataData.cs
+++ b/samples/Cdr.Banking/Cdr.Banking.Business/Data/Generated/ReferenceDataData.cs
@@ -9,42 +9,36 @@
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
+using Microsoft.Azure.Cosmos;
using Beef;
using Beef.Business;
+using Beef.Data.Cosmos;
using Beef.Mapper;
using Beef.Mapper.Converters;
-using Beef.Data.Cosmos;
using RefDataNamespace = Cdr.Banking.Common.Entities;
namespace Cdr.Banking.Business.Data
{
///
- /// Provides the ReferenceData database access.
+ /// Provides the ReferenceData data access.
///
public partial class ReferenceDataData : IReferenceDataData
{
private readonly ICosmosDb _cosmos;
- ///
- /// Parameterless constructor is explictly not supported.
- ///
- private ReferenceDataData() => throw new NotSupportedException();
-
///
/// Initializes a new instance of the class.
///
/// The .
- public ReferenceDataData(ICosmosDb cosmos) { _cosmos = Check.NotNull(cosmos, nameof(cosmos)); ReferenceDataDataCtor(); }
+ public ReferenceDataData(ICosmosDb cosmos)
+ { _cosmos = Check.NotNull(cosmos, nameof(cosmos)); DataCtor(); }
- ///
- /// Enables additional functionality to be added to the constructor.
- ///
- partial void ReferenceDataDataCtor();
+ partial void DataCtor(); // Enables additional functionality to be added to the constructor.
///
- /// Gets all the objects.
+ /// Gets all the items.
///
- /// A .
+ /// The .
public async Task OpenStatusGetAllAsync()
{
var __coll = new RefDataNamespace.OpenStatusCollection();
@@ -53,9 +47,9 @@ public partial class ReferenceDataData : IReferenceDataData
}
///
- /// Gets all the objects.
+ /// Gets all the items.
///
- /// A .
+ /// The .
public async Task ProductCategoryGetAllAsync()
{
var __coll = new RefDataNamespace.ProductCategoryCollection();
@@ -64,9 +58,9 @@ public partial class ReferenceDataData : IReferenceDataData
}
///
- /// Gets all the objects.
+ /// Gets all the items.
///
- /// A .
+ /// The .
public async Task AccountUTypeGetAllAsync()
{
var __coll = new RefDataNamespace.AccountUTypeCollection();
@@ -75,9 +69,9 @@ public partial class ReferenceDataData : IReferenceDataData
}
///
- /// Gets all the objects.
+ /// Gets all the items.
///
- /// A .
+ /// The .
public async Task MaturityInstructionsGetAllAsync()
{
var __coll = new RefDataNamespace.MaturityInstructionsCollection();
@@ -86,9 +80,9 @@ public partial class ReferenceDataData : IReferenceDataData
}
///
- /// Gets all the objects.
+ /// Gets all the items.
///
- /// A .
+ /// The .
public async Task TransactionTypeGetAllAsync()
{
var __coll = new RefDataNamespace.TransactionTypeCollection();
@@ -97,9 +91,9 @@ public partial class ReferenceDataData : IReferenceDataData
}
///
- /// Gets all the objects.
+ /// Gets all the items.
///
- /// A .
+ /// The .
public async Task TransactionStatusGetAllAsync()
{
var __coll = new RefDataNamespace.TransactionStatusCollection();
@@ -108,39 +102,39 @@ public partial class ReferenceDataData : IReferenceDataData
}
///
- /// Provides the entity and Cosmos property mapping.
+ /// Provides the and Cosmos property mapping.
///
- public static CosmosDbMapper OpenStatusMapper => CosmosDbMapper.CreateAuto()
+ public static CosmosDbMapper OpenStatusMapper => CosmosDbMapper.CreateAuto()
.AddStandardProperties();
///
- /// Provides the entity and Cosmos property mapping.
+ /// Provides the and Cosmos property mapping.
///
- public static CosmosDbMapper ProductCategoryMapper => CosmosDbMapper.CreateAuto()
+ public static CosmosDbMapper ProductCategoryMapper => CosmosDbMapper.CreateAuto()
.AddStandardProperties();
///
- /// Provides the entity and Cosmos property mapping.
+ /// Provides the and Cosmos property mapping.
///
- public static CosmosDbMapper AccountUTypeMapper => CosmosDbMapper.CreateAuto()
+ public static CosmosDbMapper AccountUTypeMapper => CosmosDbMapper.CreateAuto()
.AddStandardProperties();
///
- /// Provides the entity and Cosmos property mapping.
+ /// Provides the and Cosmos property mapping.
///
- public static CosmosDbMapper MaturityInstructionsMapper => CosmosDbMapper.CreateAuto()
+ public static CosmosDbMapper MaturityInstructionsMapper => CosmosDbMapper.CreateAuto()
.AddStandardProperties();
///
- /// Provides the entity and Cosmos property mapping.
+ /// Provides the and Cosmos property mapping.
///
- public static CosmosDbMapper TransactionTypeMapper => CosmosDbMapper.CreateAuto()
+ public static CosmosDbMapper TransactionTypeMapper => CosmosDbMapper.CreateAuto()
.AddStandardProperties();
///
- /// Provides the entity and Cosmos property mapping.
+ /// Provides the and Cosmos property mapping.
///
- public static CosmosDbMapper TransactionStatusMapper => CosmosDbMapper.CreateAuto()
+ public static CosmosDbMapper TransactionStatusMapper => CosmosDbMapper.CreateAuto()
.AddStandardProperties();
}
}
diff --git a/samples/Cdr.Banking/Cdr.Banking.Business/Data/Generated/TransactionData.cs b/samples/Cdr.Banking/Cdr.Banking.Business/Data/Generated/TransactionData.cs
index 84301822e..3097ab2ba 100644
--- a/samples/Cdr.Banking/Cdr.Banking.Business/Data/Generated/TransactionData.cs
+++ b/samples/Cdr.Banking/Cdr.Banking.Business/Data/Generated/TransactionData.cs
@@ -10,9 +10,9 @@
using System.Linq;
using System.Text;
using System.Threading.Tasks;
+using Microsoft.Azure.Cosmos;
using Beef;
using Beef.Business;
-using Microsoft.Azure.Cosmos;
using Beef.Data.Cosmos;
using Beef.Entities;
using Beef.Mapper;
@@ -23,7 +23,7 @@
namespace Cdr.Banking.Business.Data
{
///
- /// Provides the Transaction data access.
+ /// Provides the data access.
///
[System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1052:Static holder types should be Static or NotInheritable", Justification = "Will not always appear static depending on code-gen options")]
public partial class TransactionData : ITransactionData
@@ -43,20 +43,18 @@ public partial class TransactionData : ITransactionData
/// Initializes a new instance of the class.
///
/// The .
- public TransactionData(ICosmosDb cosmos) { _cosmos = Check.NotNull(cosmos, nameof(cosmos)); TransactionDataCtor(); }
+ public TransactionData(ICosmosDb cosmos)
+ { _cosmos = Check.NotNull(cosmos, nameof(cosmos)); TransactionDataCtor(); }
- ///
- /// Enables additional functionality to be added to the constructor.
- ///
- partial void TransactionDataCtor();
+ partial void TransactionDataCtor(); // Enables additional functionality to be added to the constructor.
///
/// Get transaction for account.
///
/// The Account Id.
- /// The Args (see ).
+ /// The Args (see ).
/// The .
- /// A .
+ /// The .
public Task GetTransactionsAsync(string? accountId, TransactionArgs? args, PagingArgs? paging)
{
return DataInvoker.Current.InvokeAsync(this, async () =>
@@ -69,7 +67,7 @@ public Task GetTransactionsAsync(string? accountId,
}
///
- /// Provides the entity and Cosmos property mapping.
+ /// Provides the and Cosmos property mapping.
///
[System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1034:Nested types should not be visible", Justification = "By design; as there is a direct relationship")]
public partial class CosmosMapper : CosmosDbMapper
@@ -99,10 +97,7 @@ public CosmosMapper()
CosmosMapperCtor();
}
- ///
- /// Enables the constructor to be extended.
- ///
- partial void CosmosMapperCtor();
+ partial void CosmosMapperCtor(); // Enables the CosmosMapper constructor to be extended.
}
}
}
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 fa5469b70..e2db6f222 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
@@ -8,8 +8,6 @@
using System;
using System.Collections.Generic;
-using System.ComponentModel.DataAnnotations;
-using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using Beef.Entities;
using Newtonsoft.Json;
@@ -17,7 +15,7 @@
namespace Cdr.Banking.Business.Data.Model
{
///
- /// Represents the Account model for data persistence entity.
+ /// Represents the Account model for data persistence model.
///
[JsonObject(MemberSerialization = MemberSerialization.OptIn)]
public partial class Account : IStringIdentifier
@@ -53,7 +51,7 @@ public partial class Account : IStringIdentifier
public string? OpenStatus { get; set; }
///
- /// Gets or sets a value indicating whether Is Owned.
+ /// Indicates whether Is Owned.
///
[JsonProperty("isOwned", DefaultValueHandling = DefaultValueHandling.Ignore)]
public bool IsOwned { get; set; }
@@ -101,23 +99,23 @@ public partial class Account : IStringIdentifier
public string? SpecificAccountUType { get; set; }
///
- /// Gets or sets the Term Deposit (see ).
+ /// Gets or sets the Term Deposit (see ).
///
[JsonProperty("termDeposit", DefaultValueHandling = DefaultValueHandling.Ignore)]
public TermDepositAccount? TermDeposit { get; set; }
///
- /// Gets or sets the Credit Card (see ).
+ /// Gets or sets the Credit Card (see ).
///
[JsonProperty("creditCard", DefaultValueHandling = DefaultValueHandling.Ignore)]
public CreditCardAccount? CreditCard { get; set; }
///
- /// Gets or sets the Balance (see ).
+ /// Gets or sets the Balance (see ).
///
[JsonProperty("balance", DefaultValueHandling = DefaultValueHandling.Ignore)]
public Balance? Balance { get; set; }
- }
+ }
}
#pragma warning restore CA2227, CA1819
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
new file mode 100644
index 000000000..aa7bc3998
--- /dev/null
+++ b/samples/Cdr.Banking/Cdr.Banking.Business/Data/Model/Generated/AccountUType.cs
@@ -0,0 +1,35 @@
+/*
+ * This file is automatically generated; any changes will be lost.
+ */
+
+#nullable enable
+#pragma warning disable IDE0005 // Using directive is unnecessary; are required depending on code-gen options
+#pragma warning disable CA2227, CA1819 // Collection/Array properties should be read only; ignored, as acceptable for a DTO.
+
+using System;
+using System.Collections.Generic;
+using System.Diagnostics.CodeAnalysis;
+using Beef.Entities;
+using Beef.RefData.Model;
+using Newtonsoft.Json;
+
+namespace Cdr.Banking.Business.Data.Model
+{
+ ///
+ /// Represents the Account U Type model.
+ ///
+ [JsonObject(MemberSerialization = MemberSerialization.OptIn)]
+ public partial class AccountUType : ReferenceDataBaseGuid
+ {
+ }
+
+ ///
+ /// Represents the collection.
+ ///
+ [SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1402:FileMayOnlyContainASingleClass", Justification = "Tightly coupled; OK.")]
+ public partial class AccountUTypeCollection : List { }
+}
+
+#pragma warning restore CA2227, CA1819
+#pragma warning restore IDE0005
+#nullable restore
\ No newline at end of file
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 704b72e52..e18e1c5e8 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
@@ -8,8 +8,6 @@
using System;
using System.Collections.Generic;
-using System.ComponentModel.DataAnnotations;
-using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using Beef.Entities;
using Newtonsoft.Json;
@@ -17,7 +15,7 @@
namespace Cdr.Banking.Business.Data.Model
{
///
- /// Represents the Balance entity.
+ /// Represents the Balance model.
///
[JsonObject(MemberSerialization = MemberSerialization.OptIn)]
public partial class Balance
@@ -53,11 +51,11 @@ public partial class Balance
public string? Currency { get; set; }
///
- /// Gets or sets the Purses (see ).
+ /// Gets or sets the Purses.
///
[JsonProperty("purses", DefaultValueHandling = DefaultValueHandling.Ignore)]
public BalancePurseCollection? Purses { get; set; }
- }
+ }
}
#pragma warning restore CA2227, CA1819
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 875a97a9f..1f4aee8dc 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
@@ -8,8 +8,6 @@
using System;
using System.Collections.Generic;
-using System.ComponentModel.DataAnnotations;
-using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using Beef.Entities;
using Newtonsoft.Json;
@@ -17,7 +15,7 @@
namespace Cdr.Banking.Business.Data.Model
{
///
- /// Represents the Balance Purse entity.
+ /// Represents the Balance Purse model.
///
[JsonObject(MemberSerialization = MemberSerialization.OptIn)]
public partial class BalancePurse
@@ -33,10 +31,10 @@ public partial class BalancePurse
///
[JsonProperty("currency", DefaultValueHandling = DefaultValueHandling.Ignore)]
public string? Currency { get; set; }
- }
+ }
///
- /// Represents a collection.
+ /// Represents the collection.
///
[SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1402:FileMayOnlyContainASingleClass", Justification = "Tightly coupled; OK.")]
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 1311e7df7..e4d20934b 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
@@ -8,8 +8,6 @@
using System;
using System.Collections.Generic;
-using System.ComponentModel.DataAnnotations;
-using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using Beef.Entities;
using Newtonsoft.Json;
@@ -17,7 +15,7 @@
namespace Cdr.Banking.Business.Data.Model
{
///
- /// Represents the Credit Card Account entity.
+ /// Represents the Credit Card Account model.
///
[JsonObject(MemberSerialization = MemberSerialization.OptIn)]
public partial class CreditCardAccount
@@ -45,7 +43,7 @@ public partial class CreditCardAccount
///
[JsonProperty("paymentDueDate", DefaultValueHandling = DefaultValueHandling.Ignore)]
public DateTime PaymentDueDate { get; set; }
- }
+ }
}
#pragma warning restore CA2227, CA1819
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
new file mode 100644
index 000000000..da6eb1512
--- /dev/null
+++ b/samples/Cdr.Banking/Cdr.Banking.Business/Data/Model/Generated/MaturityInstructions.cs
@@ -0,0 +1,35 @@
+/*
+ * This file is automatically generated; any changes will be lost.
+ */
+
+#nullable enable
+#pragma warning disable IDE0005 // Using directive is unnecessary; are required depending on code-gen options
+#pragma warning disable CA2227, CA1819 // Collection/Array properties should be read only; ignored, as acceptable for a DTO.
+
+using System;
+using System.Collections.Generic;
+using System.Diagnostics.CodeAnalysis;
+using Beef.Entities;
+using Beef.RefData.Model;
+using Newtonsoft.Json;
+
+namespace Cdr.Banking.Business.Data.Model
+{
+ ///
+ /// Represents the Maturity Instructions model.
+ ///
+ [JsonObject(MemberSerialization = MemberSerialization.OptIn)]
+ public partial class MaturityInstructions : ReferenceDataBaseGuid
+ {
+ }
+
+ ///
+ /// Represents the collection.
+ ///
+ [SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1402:FileMayOnlyContainASingleClass", Justification = "Tightly coupled; OK.")]
+ public partial class MaturityInstructionsCollection : List { }
+}
+
+#pragma warning restore CA2227, CA1819
+#pragma warning restore IDE0005
+#nullable restore
\ No newline at end of file
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
new file mode 100644
index 000000000..7f2d60bb6
--- /dev/null
+++ b/samples/Cdr.Banking/Cdr.Banking.Business/Data/Model/Generated/OpenStatus.cs
@@ -0,0 +1,35 @@
+/*
+ * This file is automatically generated; any changes will be lost.
+ */
+
+#nullable enable
+#pragma warning disable IDE0005 // Using directive is unnecessary; are required depending on code-gen options
+#pragma warning disable CA2227, CA1819 // Collection/Array properties should be read only; ignored, as acceptable for a DTO.
+
+using System;
+using System.Collections.Generic;
+using System.Diagnostics.CodeAnalysis;
+using Beef.Entities;
+using Beef.RefData.Model;
+using Newtonsoft.Json;
+
+namespace Cdr.Banking.Business.Data.Model
+{
+ ///
+ /// Represents the Open Status model.
+ ///
+ [JsonObject(MemberSerialization = MemberSerialization.OptIn)]
+ public partial class OpenStatus : ReferenceDataBaseGuid
+ {
+ }
+
+ ///
+ /// Represents the collection.
+ ///
+ [SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1402:FileMayOnlyContainASingleClass", Justification = "Tightly coupled; OK.")]
+ public partial class OpenStatusCollection : List { }
+}
+
+#pragma warning restore CA2227, CA1819
+#pragma warning restore IDE0005
+#nullable restore
\ No newline at end of file
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
new file mode 100644
index 000000000..ff4f09c91
--- /dev/null
+++ b/samples/Cdr.Banking/Cdr.Banking.Business/Data/Model/Generated/ProductCategory.cs
@@ -0,0 +1,35 @@
+/*
+ * This file is automatically generated; any changes will be lost.
+ */
+
+#nullable enable
+#pragma warning disable IDE0005 // Using directive is unnecessary; are required depending on code-gen options
+#pragma warning disable CA2227, CA1819 // Collection/Array properties should be read only; ignored, as acceptable for a DTO.
+
+using System;
+using System.Collections.Generic;
+using System.Diagnostics.CodeAnalysis;
+using Beef.Entities;
+using Beef.RefData.Model;
+using Newtonsoft.Json;
+
+namespace Cdr.Banking.Business.Data.Model
+{
+ ///
+ /// Represents the Product Category model.
+ ///
+ [JsonObject(MemberSerialization = MemberSerialization.OptIn)]
+ public partial class ProductCategory : ReferenceDataBaseGuid
+ {
+ }
+
+ ///
+ /// Represents the collection.
+ ///
+ [SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1402:FileMayOnlyContainASingleClass", Justification = "Tightly coupled; OK.")]
+ public partial class ProductCategoryCollection : List { }
+}
+
+#pragma warning restore CA2227, CA1819
+#pragma warning restore IDE0005
+#nullable restore
\ No newline at end of file
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 ac60e0d07..a89cc7df4 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
@@ -8,8 +8,6 @@
using System;
using System.Collections.Generic;
-using System.ComponentModel.DataAnnotations;
-using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using Beef.Entities;
using Newtonsoft.Json;
@@ -17,7 +15,7 @@
namespace Cdr.Banking.Business.Data.Model
{
///
- /// Represents the Term Deposit Account entity.
+ /// Represents the Term Deposit Account model.
///
[JsonObject(MemberSerialization = MemberSerialization.OptIn)]
public partial class TermDepositAccount
@@ -51,7 +49,7 @@ public partial class TermDepositAccount
///
[JsonProperty("maturityInstructions", DefaultValueHandling = DefaultValueHandling.Ignore)]
public string? MaturityInstructions { get; set; }
- }
+ }
}
#pragma warning restore CA2227, CA1819
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 2365c3f76..98da78003 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
@@ -8,8 +8,6 @@
using System;
using System.Collections.Generic;
-using System.ComponentModel.DataAnnotations;
-using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using Beef.Entities;
using Newtonsoft.Json;
@@ -17,7 +15,7 @@
namespace Cdr.Banking.Business.Data.Model
{
///
- /// Represents the Transaction model for data persistence entity.
+ /// Represents the Transaction model for data persistence model.
///
[JsonObject(MemberSerialization = MemberSerialization.OptIn)]
public partial class Transaction : IStringIdentifier
@@ -35,7 +33,7 @@ public partial class Transaction : IStringIdentifier
public string? AccountId { get; set; }
///
- /// Gets or sets a value indicating whether Is Detail Available.
+ /// Indicates whether Is Detail Available.
///
[JsonProperty("isDetailAvailable", DefaultValueHandling = DefaultValueHandling.Ignore)]
public bool IsDetailAvailable { get; set; }
@@ -123,7 +121,7 @@ public partial class Transaction : IStringIdentifier
///
[JsonProperty("transactionDateTime", DefaultValueHandling = DefaultValueHandling.Ignore)]
public DateTime TransactionDateTime { get; set; }
- }
+ }
}
#pragma warning restore CA2227, CA1819
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
new file mode 100644
index 000000000..122c52e9b
--- /dev/null
+++ b/samples/Cdr.Banking/Cdr.Banking.Business/Data/Model/Generated/TransactionStatus.cs
@@ -0,0 +1,35 @@
+/*
+ * This file is automatically generated; any changes will be lost.
+ */
+
+#nullable enable
+#pragma warning disable IDE0005 // Using directive is unnecessary; are required depending on code-gen options
+#pragma warning disable CA2227, CA1819 // Collection/Array properties should be read only; ignored, as acceptable for a DTO.
+
+using System;
+using System.Collections.Generic;
+using System.Diagnostics.CodeAnalysis;
+using Beef.Entities;
+using Beef.RefData.Model;
+using Newtonsoft.Json;
+
+namespace Cdr.Banking.Business.Data.Model
+{
+ ///
+ /// Represents the Transaction Status model.
+ ///
+ [JsonObject(MemberSerialization = MemberSerialization.OptIn)]
+ public partial class TransactionStatus : ReferenceDataBaseGuid
+ {
+ }
+
+ ///
+ /// Represents the collection.
+ ///
+ [SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1402:FileMayOnlyContainASingleClass", Justification = "Tightly coupled; OK.")]
+ public partial class TransactionStatusCollection : List { }
+}
+
+#pragma warning restore CA2227, CA1819
+#pragma warning restore IDE0005
+#nullable restore
\ No newline at end of file
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
new file mode 100644
index 000000000..8dba21449
--- /dev/null
+++ b/samples/Cdr.Banking/Cdr.Banking.Business/Data/Model/Generated/TransactionType.cs
@@ -0,0 +1,35 @@
+/*
+ * This file is automatically generated; any changes will be lost.
+ */
+
+#nullable enable
+#pragma warning disable IDE0005 // Using directive is unnecessary; are required depending on code-gen options
+#pragma warning disable CA2227, CA1819 // Collection/Array properties should be read only; ignored, as acceptable for a DTO.
+
+using System;
+using System.Collections.Generic;
+using System.Diagnostics.CodeAnalysis;
+using Beef.Entities;
+using Beef.RefData.Model;
+using Newtonsoft.Json;
+
+namespace Cdr.Banking.Business.Data.Model
+{
+ ///
+ /// Represents the Transaction Type model.
+ ///
+ [JsonObject(MemberSerialization = MemberSerialization.OptIn)]
+ public partial class TransactionType : ReferenceDataBaseGuid
+ {
+ }
+
+ ///
+ /// Represents the collection.
+ ///
+ [SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1402:FileMayOnlyContainASingleClass", Justification = "Tightly coupled; OK.")]
+ public partial class TransactionTypeCollection : List { }
+}
+
+#pragma warning restore CA2227, CA1819
+#pragma warning restore IDE0005
+#nullable restore
\ No newline at end of file
diff --git a/samples/Cdr.Banking/Cdr.Banking.Business/DataSvc/Generated/AccountDataSvc.cs b/samples/Cdr.Banking/Cdr.Banking.Business/DataSvc/Generated/AccountDataSvc.cs
index 57a5c0cb3..8d7d96482 100644
--- a/samples/Cdr.Banking/Cdr.Banking.Business/DataSvc/Generated/AccountDataSvc.cs
+++ b/samples/Cdr.Banking/Cdr.Banking.Business/DataSvc/Generated/AccountDataSvc.cs
@@ -20,7 +20,7 @@
namespace Cdr.Banking.Business.DataSvc
{
///
- /// Provides the Account data repository services.
+ /// Provides the data repository services.
///
public partial class AccountDataSvc : IAccountDataSvc
{
@@ -35,20 +35,17 @@ public partial class AccountDataSvc : IAccountDataSvc
public AccountDataSvc(IAccountData data, IRequestCache cache)
{ _data = Check.NotNull(data, nameof(data)); _cache = Check.NotNull(cache, nameof(cache)); AccountDataSvcCtor(); }
- ///
- /// Enables additional functionality to be added to the constructor.
- ///
- partial void AccountDataSvcCtor();
+ partial void AccountDataSvcCtor(); // Enables additional functionality to be added to the constructor.
///
/// Get all accounts.
///
- /// The Args (see ).
+ /// The Args (see ).
/// The .
- /// A .
+ /// The .
public Task GetAccountsAsync(AccountArgs? args, PagingArgs? paging)
{
- return DataSvcInvoker.Current.InvokeAsync(typeof(AccountDataSvc), async () =>
+ return DataSvcInvoker.Current.InvokeAsync(this, async () =>
{
var __result = await _data.GetAccountsAsync(args, paging).ConfigureAwait(false);
return __result;
@@ -59,17 +56,17 @@ public Task GetAccountsAsync(AccountArgs? args, PagingA
/// Get .
///
/// The identifier.
- /// The selected object where found; otherwise, null.
+ /// The selected where found.
public Task GetDetailAsync(string? accountId)
{
- return DataSvcInvoker.Current.InvokeAsync(typeof(AccountDataSvc), async () =>
+ return DataSvcInvoker.Current.InvokeAsync(this, async () =>
{
var __key = new UniqueKey(accountId);
- if (_cache.TryGetValue(__key, out AccountDetail __val))
+ if (_cache.TryGetValue(__key, out AccountDetail? __val))
return __val;
var __result = await _data.GetDetailAsync(accountId).ConfigureAwait(false);
- _cache.SetValue(__key, __result!);
+ _cache.SetValue(__key, __result);
return __result;
});
}
@@ -78,17 +75,17 @@ public Task GetAccountsAsync(AccountArgs? args, PagingA
/// Get .
///
/// The identifier.
- /// The selected object where found; otherwise, null.
+ /// The selected where found.
public Task GetBalanceAsync(string? accountId)
{
- return DataSvcInvoker.Current.InvokeAsync(typeof(AccountDataSvc), async () =>
+ return DataSvcInvoker.Current.InvokeAsync(this, async () =>
{
var __key = new UniqueKey(accountId);
- if (_cache.TryGetValue(__key, out Balance __val))
+ if (_cache.TryGetValue(__key, out Balance? __val))
return __val;
var __result = await _data.GetBalanceAsync(accountId).ConfigureAwait(false);
- _cache.SetValue(__key, __result!);
+ _cache.SetValue(__key, __result);
return __result;
});
}
diff --git a/samples/Cdr.Banking/Cdr.Banking.Business/DataSvc/Generated/IAccountDataSvc.cs b/samples/Cdr.Banking/Cdr.Banking.Business/DataSvc/Generated/IAccountDataSvc.cs
index 228bdab7f..4934ebfa8 100644
--- a/samples/Cdr.Banking/Cdr.Banking.Business/DataSvc/Generated/IAccountDataSvc.cs
+++ b/samples/Cdr.Banking/Cdr.Banking.Business/DataSvc/Generated/IAccountDataSvc.cs
@@ -17,30 +17,30 @@
namespace Cdr.Banking.Business.DataSvc
{
///
- /// Defines the Account data repository services.
+ /// Defines the data repository services.
///
public partial interface IAccountDataSvc
{
///
/// Get all accounts.
///
- /// The Args (see ).
+ /// The Args (see ).
/// The .
- /// A .
+ /// The .
Task GetAccountsAsync(AccountArgs? args, PagingArgs? paging);
///
/// Get .
///
/// The identifier.
- /// The selected object where found; otherwise, null.
+ /// The selected where found.
Task GetDetailAsync(string? accountId);
///
/// Get .
///
/// The identifier.
- /// The selected object where found; otherwise, null.
+ /// The selected where found.
Task GetBalanceAsync(string? accountId);
}
}
diff --git a/samples/Cdr.Banking/Cdr.Banking.Business/DataSvc/Generated/IReferenceDataDataSvc.cs b/samples/Cdr.Banking/Cdr.Banking.Business/DataSvc/Generated/IReferenceDataDataSvc.cs
index 8fa899190..d31f36556 100644
--- a/samples/Cdr.Banking/Cdr.Banking.Business/DataSvc/Generated/IReferenceDataDataSvc.cs
+++ b/samples/Cdr.Banking/Cdr.Banking.Business/DataSvc/Generated/IReferenceDataDataSvc.cs
@@ -5,9 +5,8 @@
#nullable enable
#pragma warning disable IDE0005 // Using directive is unnecessary; are required depending on code-gen options
-using Beef.RefData;
using System;
-
+using Beef.RefData;
using RefDataNamespace = Cdr.Banking.Common.Entities;
namespace Cdr.Banking.Business.DataSvc
@@ -15,7 +14,7 @@ namespace Cdr.Banking.Business.DataSvc
///
/// Provides the ReferenceData data services.
///
- public interface IReferenceDataDataSvc
+ public partial interface IReferenceDataDataSvc
{
///
/// Gets the for the associated .
diff --git a/samples/Cdr.Banking/Cdr.Banking.Business/DataSvc/Generated/ITransactionDataSvc.cs b/samples/Cdr.Banking/Cdr.Banking.Business/DataSvc/Generated/ITransactionDataSvc.cs
index 88fa610f4..1ca8af329 100644
--- a/samples/Cdr.Banking/Cdr.Banking.Business/DataSvc/Generated/ITransactionDataSvc.cs
+++ b/samples/Cdr.Banking/Cdr.Banking.Business/DataSvc/Generated/ITransactionDataSvc.cs
@@ -17,7 +17,7 @@
namespace Cdr.Banking.Business.DataSvc
{
///
- /// Defines the Transaction data repository services.
+ /// Defines the data repository services.
///
public partial interface ITransactionDataSvc
{
@@ -25,9 +25,9 @@ public partial interface ITransactionDataSvc
/// Get transaction for account.
///
/// The Account Id.
- /// The Args (see ).
+ /// The Args (see ).
/// The .
- /// A .
+ /// The .
Task GetTransactionsAsync(string? accountId, TransactionArgs? args, PagingArgs? paging);
}
}
diff --git a/samples/Cdr.Banking/Cdr.Banking.Business/DataSvc/Generated/ReferenceDataDataSvc.cs b/samples/Cdr.Banking/Cdr.Banking.Business/DataSvc/Generated/ReferenceDataDataSvc.cs
index 492b35739..bfe4dcb8f 100644
--- a/samples/Cdr.Banking/Cdr.Banking.Business/DataSvc/Generated/ReferenceDataDataSvc.cs
+++ b/samples/Cdr.Banking/Cdr.Banking.Business/DataSvc/Generated/ReferenceDataDataSvc.cs
@@ -23,7 +23,7 @@ namespace Cdr.Banking.Business.DataSvc
///
/// Provides the ReferenceData data services.
///
- public class ReferenceDataDataSvc : IReferenceDataDataSvc
+ public partial class ReferenceDataDataSvc : IReferenceDataDataSvc
{
private readonly IServiceProvider _provider;
private readonly Dictionary _cacheDict = new Dictionary();
@@ -41,8 +41,11 @@ public ReferenceDataDataSvc(IServiceProvider provider)
_cacheDict.Add(typeof(RefDataNamespace.MaturityInstructions), new ReferenceDataCache(() => DataSvcInvoker.Current.InvokeAsync(typeof(ReferenceDataDataSvc), () => GetDataAsync(data => data.MaturityInstructionsGetAllAsync()))));
_cacheDict.Add(typeof(RefDataNamespace.TransactionType), new ReferenceDataCache(() => DataSvcInvoker.Current.InvokeAsync(typeof(ReferenceDataDataSvc), () => GetDataAsync(data => data.TransactionTypeGetAllAsync()))));
_cacheDict.Add(typeof(RefDataNamespace.TransactionStatus), new ReferenceDataCache(() => DataSvcInvoker.Current.InvokeAsync(typeof(ReferenceDataDataSvc), () => GetDataAsync(data => data.TransactionStatusGetAllAsync()))));
+ ReferenceDataDataSvcCtor();
}
+ partial void ReferenceDataDataSvcCtor(); // Enables the ReferenceDataDataSvc constructor to be extended.
+
///
/// Gets the data within a new scope; each reference data request needs to occur separately and independently.
///
@@ -57,13 +60,9 @@ private async Task GetDataAsync(Func> func)
///
/// The type associated
/// A .
- public IReferenceDataCollection GetCollection(Type type)
- {
- if (_cacheDict.TryGetValue(type ?? throw new ArgumentNullException(nameof(type)), out var rdc))
- return rdc.GetCollection();
- else
+ public IReferenceDataCollection GetCollection(Type type) =>
+ _cacheDict.TryGetValue(type ?? throw new ArgumentNullException(nameof(type)), out var rdc) ? rdc.GetCollection() :
throw new ArgumentException($"Type {type.Name} does not exist within the ReferenceDataDataSvc cache.", nameof(type));
- }
}
}
diff --git a/samples/Cdr.Banking/Cdr.Banking.Business/DataSvc/Generated/TransactionDataSvc.cs b/samples/Cdr.Banking/Cdr.Banking.Business/DataSvc/Generated/TransactionDataSvc.cs
index b582312a5..331976c01 100644
--- a/samples/Cdr.Banking/Cdr.Banking.Business/DataSvc/Generated/TransactionDataSvc.cs
+++ b/samples/Cdr.Banking/Cdr.Banking.Business/DataSvc/Generated/TransactionDataSvc.cs
@@ -19,7 +19,7 @@
namespace Cdr.Banking.Business.DataSvc
{
///
- /// Provides the Transaction data repository services.
+ /// Provides the data repository services.
///
public partial class TransactionDataSvc : ITransactionDataSvc
{
@@ -32,21 +32,18 @@ public partial class TransactionDataSvc : ITransactionDataSvc
public TransactionDataSvc(ITransactionData data)
{ _data = Check.NotNull(data, nameof(data)); TransactionDataSvcCtor(); }
- ///
- /// Enables additional functionality to be added to the constructor.
- ///
- partial void TransactionDataSvcCtor();
+ partial void TransactionDataSvcCtor(); // Enables additional functionality to be added to the constructor.
///
/// Get transaction for account.
///
/// The Account Id.
- /// The Args (see ).
+ /// The Args (see ).
/// The .
- /// A .
+ /// The .
public Task GetTransactionsAsync(string? accountId, TransactionArgs? args, PagingArgs? paging)
{
- return DataSvcInvoker.Current.InvokeAsync(typeof(TransactionDataSvc), async () =>
+ return DataSvcInvoker.Current.InvokeAsync(this, async () =>
{
var __result = await _data.GetTransactionsAsync(accountId, args, paging).ConfigureAwait(false);
return __result;
diff --git a/samples/Cdr.Banking/Cdr.Banking.Business/Generated/AccountManager.cs b/samples/Cdr.Banking/Cdr.Banking.Business/Generated/AccountManager.cs
index ea53c0420..bf0624dec 100644
--- a/samples/Cdr.Banking/Cdr.Banking.Business/Generated/AccountManager.cs
+++ b/samples/Cdr.Banking/Cdr.Banking.Business/Generated/AccountManager.cs
@@ -14,14 +14,14 @@
using Beef.Entities;
using Beef.Validation;
using Cdr.Banking.Common.Entities;
-using Cdr.Banking.Business.Validation;
using Cdr.Banking.Business.DataSvc;
+using Cdr.Banking.Business.Validation;
using RefDataNamespace = Cdr.Banking.Common.Entities;
namespace Cdr.Banking.Business
{
///
- /// Provides the Account business functionality.
+ /// Provides the business functionality.
///
public partial class AccountManager : IAccountManager
{
@@ -31,29 +31,24 @@ public partial class AccountManager : IAccountManager
/// Initializes a new instance of the class.
///
/// The .
- public AccountManager(IAccountDataSvc dataService) { _dataService = Check.NotNull(dataService, nameof(dataService)); AccountManagerCtor(); }
+ public AccountManager(IAccountDataSvc dataService)
+ { _dataService = Check.NotNull(dataService, nameof(dataService)); AccountManagerCtor(); }
- ///
- /// Enables additional functionality to be added to the constructor.
- ///
- partial void AccountManagerCtor();
+ partial void AccountManagerCtor(); // Enables additional functionality to be added to the constructor.
///
/// Get all accounts.
///
- /// The Args (see ).
+ /// The Args (see ).
/// The .
- /// A .
+ /// The .
public Task GetAccountsAsync(AccountArgs? args, PagingArgs? paging)
{
return ManagerInvoker.Current.InvokeAsync(this, async () =>
{
ExecutionContext.Current.OperationType = OperationType.Read;
Cleaner.CleanUp(args);
- MultiValidator.Create()
- .Add(args.Validate(nameof(args)).Entity(AccountArgsValidator.Default))
- .Run().ThrowOnError();
-
+ args.Validate(nameof(args)).Entity(AccountArgsValidator.Default).Run().ThrowOnError();
return Cleaner.Clean(await _dataService.GetAccountsAsync(args, paging).ConfigureAwait(false));
});
}
@@ -62,17 +57,14 @@ public Task GetAccountsAsync(AccountArgs? args, PagingA
/// Get .
///
/// The identifier.
- /// The selected object where found; otherwise, null.
+ /// The selected where found.
public Task GetDetailAsync(string? accountId)
{
return ManagerInvoker.Current.InvokeAsync(this, async () =>
{
ExecutionContext.Current.OperationType = OperationType.Read;
Cleaner.CleanUp(accountId);
- MultiValidator.Create()
- .Add(accountId.Validate(nameof(accountId)).Mandatory())
- .Run().ThrowOnError();
-
+ accountId.Validate(nameof(accountId)).Mandatory().Run().ThrowOnError();
return Cleaner.Clean(await _dataService.GetDetailAsync(accountId).ConfigureAwait(false));
});
}
@@ -81,17 +73,14 @@ public Task GetAccountsAsync(AccountArgs? args, PagingA
/// Get .
///
/// The identifier.
- /// The selected object where found; otherwise, null.
+ /// The selected where found.
public Task GetBalanceAsync(string? accountId)
{
return ManagerInvoker.Current.InvokeAsync(this, async () =>
{
ExecutionContext.Current.OperationType = OperationType.Read;
Cleaner.CleanUp(accountId);
- MultiValidator.Create()
- .Add(accountId.Validate(nameof(accountId)).Mandatory())
- .Run().ThrowOnError();
-
+ accountId.Validate(nameof(accountId)).Mandatory().Run().ThrowOnError();
return Cleaner.Clean(await _dataService.GetBalanceAsync(accountId).ConfigureAwait(false));
});
}
diff --git a/samples/Cdr.Banking/Cdr.Banking.Business/Generated/IAccountManager.cs b/samples/Cdr.Banking/Cdr.Banking.Business/Generated/IAccountManager.cs
index afa149c49..1a0f877d5 100644
--- a/samples/Cdr.Banking/Cdr.Banking.Business/Generated/IAccountManager.cs
+++ b/samples/Cdr.Banking/Cdr.Banking.Business/Generated/IAccountManager.cs
@@ -17,30 +17,30 @@
namespace Cdr.Banking.Business
{
///
- /// Defines the Account business functionality.
+ /// Defines the business functionality.
///
public partial interface IAccountManager
{
///
/// Get all accounts.
///
- /// The Args (see ).
+ /// The Args (see ).
/// The .
- /// A .
+ /// The .
Task GetAccountsAsync(AccountArgs? args, PagingArgs? paging);
///
/// Get .
///
/// The identifier.
- /// The selected object where found; otherwise, null.
+ /// The selected where found.
Task GetDetailAsync(string? accountId);
///
/// Get .
///
/// The identifier.
- /// The selected object where found; otherwise, null.
+ /// The selected where found.
Task GetBalanceAsync(string? accountId);
}
}
diff --git a/samples/Cdr.Banking/Cdr.Banking.Business/Generated/ITransactionManager.cs b/samples/Cdr.Banking/Cdr.Banking.Business/Generated/ITransactionManager.cs
index f4dae8d62..c676ec501 100644
--- a/samples/Cdr.Banking/Cdr.Banking.Business/Generated/ITransactionManager.cs
+++ b/samples/Cdr.Banking/Cdr.Banking.Business/Generated/ITransactionManager.cs
@@ -17,7 +17,7 @@
namespace Cdr.Banking.Business
{
///
- /// Defines the Transaction business functionality.
+ /// Defines the business functionality.
///
public partial interface ITransactionManager
{
@@ -25,9 +25,9 @@ public partial interface ITransactionManager
/// Get transaction for account.
///
/// The Account Id.
- /// The Args (see ).
+ /// The Args (see ).
/// The .
- /// A .
+ /// The .
Task GetTransactionsAsync(string? accountId, TransactionArgs? args, PagingArgs? paging);
}
}
diff --git a/samples/Cdr.Banking/Cdr.Banking.Business/Generated/ReferenceDataProvider.cs b/samples/Cdr.Banking/Cdr.Banking.Business/Generated/ReferenceDataProvider.cs
index 45720fe2f..77cb76d84 100644
--- a/samples/Cdr.Banking/Cdr.Banking.Business/Generated/ReferenceDataProvider.cs
+++ b/samples/Cdr.Banking/Cdr.Banking.Business/Generated/ReferenceDataProvider.cs
@@ -20,7 +20,7 @@ namespace Cdr.Banking.Business
///
/// Provides the implementation using the corresponding data services.
///
- public class ReferenceDataProvider : RefDataNamespace.ReferenceData
+ public partial class ReferenceDataProvider : RefDataNamespace.ReferenceData
{
private readonly IReferenceDataDataSvc _dataService;
@@ -28,8 +28,10 @@ public class ReferenceDataProvider : RefDataNamespace.ReferenceData
/// Initializes a new instance of the class.
///
/// The .
- public ReferenceDataProvider(IReferenceDataDataSvc dataService) => _dataService = Check.NotNull(dataService, nameof(dataService));
-
+ public ReferenceDataProvider(IReferenceDataDataSvc dataService) { _dataService = Check.NotNull(dataService, nameof(dataService)); ReferenceDataProviderCtor(); }
+
+ partial void ReferenceDataProviderCtor(); // Enables the ReferenceDataProvider constructor to be extended.
+
#region Collections
///
@@ -63,7 +65,7 @@ public class ReferenceDataProvider : RefDataNamespace.ReferenceData
public override RefDataNamespace.TransactionStatusCollection TransactionStatus => (RefDataNamespace.TransactionStatusCollection)this[typeof(RefDataNamespace.TransactionStatus)];
#endregion
-
+
///
/// Gets the for the associated .
///
diff --git a/samples/Cdr.Banking/Cdr.Banking.Business/Generated/TransactionManager.cs b/samples/Cdr.Banking/Cdr.Banking.Business/Generated/TransactionManager.cs
index 321e7fb4c..bf70f76ac 100644
--- a/samples/Cdr.Banking/Cdr.Banking.Business/Generated/TransactionManager.cs
+++ b/samples/Cdr.Banking/Cdr.Banking.Business/Generated/TransactionManager.cs
@@ -14,14 +14,14 @@
using Beef.Entities;
using Beef.Validation;
using Cdr.Banking.Common.Entities;
-using Cdr.Banking.Business.Validation;
using Cdr.Banking.Business.DataSvc;
+using Cdr.Banking.Business.Validation;
using RefDataNamespace = Cdr.Banking.Common.Entities;
namespace Cdr.Banking.Business
{
///
- /// Provides the Transaction business functionality.
+ /// Provides the business functionality.
///
public partial class TransactionManager : ITransactionManager
{
@@ -31,20 +31,18 @@ public partial class TransactionManager : ITransactionManager
/// Initializes a new instance of the class.
///
/// The .
- public TransactionManager(ITransactionDataSvc dataService) { _dataService = Check.NotNull(dataService, nameof(dataService)); TransactionManagerCtor(); }
+ public TransactionManager(ITransactionDataSvc dataService)
+ { _dataService = Check.NotNull(dataService, nameof(dataService)); TransactionManagerCtor(); }
- ///
- /// Enables additional functionality to be added to the constructor.
- ///
- partial void TransactionManagerCtor();
+ partial void TransactionManagerCtor(); // Enables additional functionality to be added to the constructor.
///
/// Get transaction for account.
///
/// The Account Id.
- /// The Args (see ).
+ /// The Args (see ).
/// The .
- /// A .
+ /// The .
public Task GetTransactionsAsync(string? accountId, TransactionArgs? args, PagingArgs? paging)
{
return ManagerInvoker.Current.InvokeAsync(this, async () =>
diff --git a/samples/Cdr.Banking/Cdr.Banking.CodeGen/Cdr.RefData.xml b/samples/Cdr.Banking/Cdr.Banking.CodeGen/Cdr.RefData.xml
index 0d8d8f092..b035c5299 100644
--- a/samples/Cdr.Banking/Cdr.Banking.CodeGen/Cdr.RefData.xml
+++ b/samples/Cdr.Banking/Cdr.Banking.CodeGen/Cdr.RefData.xml
@@ -3,14 +3,14 @@
-
+
-
-
-
-
-
+
+
+
+
+
\ No newline at end of file
diff --git a/samples/Cdr.Banking/Cdr.Banking.Common/Agents/Generated/AccountAgent.cs b/samples/Cdr.Banking/Cdr.Banking.Common/Agents/Generated/AccountAgent.cs
index 1803d1a1b..ca9e1e793 100644
--- a/samples/Cdr.Banking/Cdr.Banking.Common/Agents/Generated/AccountAgent.cs
+++ b/samples/Cdr.Banking/Cdr.Banking.Common/Agents/Generated/AccountAgent.cs
@@ -1,5 +1,5 @@
/*
- * This file is automatically generated; any changes will be lost.
+ * This file is automatically generated; any changes will be lost.
*/
#nullable enable
@@ -19,14 +19,14 @@
namespace Cdr.Banking.Common.Agents
{
///
- /// Defines the Account Web API agent.
+ /// Defines the Web API agent.
///
public partial interface IAccountAgent
{
///
/// Get all accounts.
///
- /// The Args (see ).
+ /// The Args (see ).
/// The .
/// The optional .
/// A .
@@ -38,7 +38,7 @@ public partial interface IAccountAgent
/// The identifier.
/// The optional .
/// A .
- Task> GetDetailAsync(string? accountId, WebApiRequestOptions? requestOptions = null);
+ Task> GetDetailAsync(string? accountId, WebApiRequestOptions? requestOptions = null);
///
/// Get .
@@ -46,11 +46,11 @@ public partial interface IAccountAgent
/// The identifier.
/// The optional .
/// A .
- Task> GetBalanceAsync(string? accountId, WebApiRequestOptions? requestOptions = null);
+ Task> GetBalanceAsync(string? accountId, WebApiRequestOptions? requestOptions = null);
}
///
- /// Provides the Account Web API agent.
+ /// Provides the Web API agent.
///
public partial class AccountAgent : WebApiAgentBase, IAccountAgent
{
@@ -63,15 +63,13 @@ public AccountAgent(IWebApiAgentArgs args) : base(args) { }
///
/// Get all accounts.
///
- /// The Args (see ).
+ /// The Args (see ).
/// The .
/// The optional .
/// A .
- public Task> GetAccountsAsync(AccountArgs? args, PagingArgs? paging = null, WebApiRequestOptions? requestOptions = null)
- {
- return GetCollectionResultAsync("api/v1/banking/accounts", requestOptions: requestOptions,
+ public Task> GetAccountsAsync(AccountArgs? args, PagingArgs? paging = null, WebApiRequestOptions? requestOptions = null) =>
+ GetCollectionResultAsync("api/v1/banking/accounts", requestOptions: requestOptions,
args: new WebApiArg[] { new WebApiArg("args", args, WebApiArgType.FromUriUseProperties), new WebApiPagingArgsArg("paging", paging) });
- }
///
/// Get .
@@ -79,11 +77,9 @@ public Task> GetAccountsAsync(Account
/// The identifier.
/// The optional .
/// A .
- public Task> GetDetailAsync(string? accountId, WebApiRequestOptions? requestOptions = null)
- {
- return GetAsync("api/v1/banking/accounts/{accountId}", requestOptions: requestOptions,
+ public Task> GetDetailAsync(string? accountId, WebApiRequestOptions? requestOptions = null) =>
+ GetAsync("api/v1/banking/accounts/{accountId}", requestOptions: requestOptions,
args: new WebApiArg[] { new WebApiArg("accountId", accountId) });
- }
///
/// Get .
@@ -91,11 +87,9 @@ public Task> GetDetailAsync(string? accountId,
/// The identifier.
/// The optional .
/// A .
- public Task> GetBalanceAsync(string? accountId, WebApiRequestOptions? requestOptions = null)
- {
- return GetAsync("api/v1/banking/accounts/{accountId}/balance", requestOptions: requestOptions,
+ public Task> GetBalanceAsync(string? accountId, WebApiRequestOptions? requestOptions = null) =>
+ GetAsync("api/v1/banking/accounts/{accountId}/balance", requestOptions: requestOptions,
args: new WebApiArg[] { new WebApiArg("accountId", accountId) });
- }
}
}
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 0332100a8..0ceb2ec5c 100644
--- a/samples/Cdr.Banking/Cdr.Banking.Common/Agents/Generated/ReferenceDataAgent.cs
+++ b/samples/Cdr.Banking/Cdr.Banking.Common/Agents/Generated/ReferenceDataAgent.cs
@@ -23,7 +23,7 @@ namespace Cdr.Banking.Common.Agents
public partial interface IReferenceDataAgent
{
///
- /// Gets all of the objects that match the filter arguments.
+ /// Gets all of the items that match the filter arguments.
///
/// The optional arguments.
/// The optional .
@@ -31,7 +31,7 @@ public partial interface IReferenceDataAgent
Task> OpenStatusGetAllAsync(ReferenceDataFilter? args = null, WebApiRequestOptions? requestOptions = null);
///
- /// Gets all of the objects that match the filter arguments.
+ /// Gets all of the items that match the filter arguments.
///
/// The optional arguments.
/// The optional .
@@ -39,7 +39,7 @@ public partial interface IReferenceDataAgent
Task> ProductCategoryGetAllAsync(ReferenceDataFilter? args = null, WebApiRequestOptions? requestOptions = null);
///
- /// Gets all of the objects that match the filter arguments.
+ /// Gets all of the items that match the filter arguments.
///
/// The optional arguments.
/// The optional .
@@ -47,7 +47,7 @@ public partial interface IReferenceDataAgent
Task> AccountUTypeGetAllAsync(ReferenceDataFilter? args = null, WebApiRequestOptions? requestOptions = null);
///
- /// Gets all of the objects that match the filter arguments.
+ /// Gets all of the items that match the filter arguments.
///
/// The optional arguments.
/// The optional .
@@ -55,7 +55,7 @@ public partial interface IReferenceDataAgent
Task> MaturityInstructionsGetAllAsync(ReferenceDataFilter? args = null, WebApiRequestOptions? requestOptions = null);
///
- /// Gets all of the objects that match the filter arguments.
+ /// Gets all of the items that match the filter arguments.
///
/// The optional arguments.
/// The optional .
@@ -63,7 +63,7 @@ public partial interface IReferenceDataAgent
Task> TransactionTypeGetAllAsync(ReferenceDataFilter? args = null, WebApiRequestOptions? requestOptions = null);
///
- /// Gets all of the objects that match the filter arguments.
+ /// Gets all of the items that match the filter arguments.
///
/// The optional arguments.
/// The optional .
@@ -92,7 +92,7 @@ public partial class ReferenceDataAgent : WebApiAgentBase, IReferenceDataAgent
public ReferenceDataAgent(IWebApiAgentArgs args) : base(args) { }
///
- /// Gets all of the objects that match the filter arguments.
+ /// Gets all of the items that match the filter arguments.
///
/// The optional arguments.
/// The optional .
@@ -101,7 +101,7 @@ public ReferenceDataAgent(IWebApiAgentArgs args) : base(args) { }
GetAsync("api/v1/ref/openStatuses", requestOptions: requestOptions, args: new WebApiArg[] { new WebApiArg("args", args!, WebApiArgType.FromUriUseProperties) });
///
- /// Gets all of the objects that match the filter arguments.
+ /// Gets all of the items that match the filter arguments.
///
/// The optional arguments.
/// The optional .
@@ -110,7 +110,7 @@ public ReferenceDataAgent(IWebApiAgentArgs args) : base(args) { }
GetAsync("api/v1/ref/productCategories", requestOptions: requestOptions, args: new WebApiArg[] { new WebApiArg("args", args!, WebApiArgType.FromUriUseProperties) });
///
- /// Gets all of the objects that match the filter arguments.
+ /// Gets all of the items that match the filter arguments.
///
/// The optional arguments.
/// The optional .
@@ -119,7 +119,7 @@ public ReferenceDataAgent(IWebApiAgentArgs args) : base(args) { }
GetAsync("api/v1/ref/accountUTypes", requestOptions: requestOptions, args: new WebApiArg[] { new WebApiArg("args", args!, WebApiArgType.FromUriUseProperties) });
///
- /// Gets all of the objects that match the filter arguments.
+ /// Gets all of the items that match the filter arguments.
///
/// The optional arguments.
/// The optional .
@@ -128,7 +128,7 @@ public ReferenceDataAgent(IWebApiAgentArgs args) : base(args) { }
GetAsync("api/v1/ref/maturityInstructions", requestOptions: requestOptions, args: new WebApiArg[] { new WebApiArg("args", args!, WebApiArgType.FromUriUseProperties) });
///
- /// Gets all of the objects that match the filter arguments.
+ /// Gets all of the items that match the filter arguments.
///
/// The optional arguments.
/// The optional .
@@ -137,7 +137,7 @@ public ReferenceDataAgent(IWebApiAgentArgs args) : base(args) { }
GetAsync("api/v1/ref/transactionTypes", requestOptions: requestOptions, args: new WebApiArg[] { new WebApiArg("args", args!, WebApiArgType.FromUriUseProperties) });
///
- /// Gets all of the objects that match the filter arguments.
+ /// Gets all of the items that match the filter arguments.
///
/// The optional arguments.
/// The optional .
@@ -148,7 +148,7 @@ public ReferenceDataAgent(IWebApiAgentArgs args) : base(args) { }
///
/// 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 list of reference data names.
+ /// The optional list of reference data names.
/// The optional .
/// A .
/// The reference data objects will need to be manually extracted from the corresponding response content.
diff --git a/samples/Cdr.Banking/Cdr.Banking.Common/Agents/Generated/ReferenceDataAgentProvider.cs b/samples/Cdr.Banking/Cdr.Banking.Common/Agents/Generated/ReferenceDataAgentProvider.cs
index 93fa85cd5..8a2c26d2a 100644
--- a/samples/Cdr.Banking/Cdr.Banking.Common/Agents/Generated/ReferenceDataAgentProvider.cs
+++ b/samples/Cdr.Banking/Cdr.Banking.Common/Agents/Generated/ReferenceDataAgentProvider.cs
@@ -23,7 +23,7 @@ namespace Cdr.Banking.Common.Agents
///
/// Provides the implementation using the corresponding Web API agent.
///
- public class ReferenceDataAgentProvider : RefDataNamespace.ReferenceData
+ public partial class ReferenceDataAgentProvider : RefDataNamespace.ReferenceData
{
private readonly Dictionary _nameDict = new Dictionary();
private readonly Dictionary _typeDict = new Dictionary();
@@ -64,50 +64,53 @@ public ReferenceDataAgentProvider(IReferenceDataAgent agent)
_typeDict.Add(typeof(RefDataNamespace.TransactionStatus), nameof(TransactionStatus));
_cacheDict.Add(typeof(RefDataNamespace.TransactionStatus), new ReferenceDataCache(() => _agent.TransactionStatusGetAllAsync().ContinueWith((t) => t.Result.Value, TaskScheduler.Current)));
+ ReferenceDataAgentProviderCtor();
}
+ partial void ReferenceDataAgentProviderCtor(); // Enables the ReferenceDataAgentProvider constructor to be extended.
+
#endregion
#region Collections
- ///
+ ///
/// Gets the .
///
/// The .
public override RefDataNamespace.OpenStatusCollection OpenStatus => (RefDataNamespace.OpenStatusCollection)this[typeof(RefDataNamespace.OpenStatus)];
- ///
+ ///
/// Gets the .
///
/// The .
public override RefDataNamespace.ProductCategoryCollection ProductCategory => (RefDataNamespace.ProductCategoryCollection)this[typeof(RefDataNamespace.ProductCategory)];
- ///
+ ///
/// Gets the .
///
/// The .
public override RefDataNamespace.AccountUTypeCollection AccountUType => (RefDataNamespace.AccountUTypeCollection)this[typeof(RefDataNamespace.AccountUType)];
- ///
+ ///
/// Gets the .
///
/// The .
public override RefDataNamespace.MaturityInstructionsCollection MaturityInstructions => (RefDataNamespace.MaturityInstructionsCollection)this[typeof(RefDataNamespace.MaturityInstructions)];
- ///
+ ///
/// Gets the .
///
/// The .
public override RefDataNamespace.TransactionTypeCollection TransactionType => (RefDataNamespace.TransactionTypeCollection)this[typeof(RefDataNamespace.TransactionType)];
- ///
+ ///
/// Gets the .
///
/// The .
public override RefDataNamespace.TransactionStatusCollection TransactionStatus => (RefDataNamespace.TransactionStatusCollection)this[typeof(RefDataNamespace.TransactionStatus)];
#endregion
-
+
#region This/GetCache/PrefetchAsync
///
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 ce875334e..6f9c3d854 100644
--- a/samples/Cdr.Banking/Cdr.Banking.Common/Agents/Generated/TransactionAgent.cs
+++ b/samples/Cdr.Banking/Cdr.Banking.Common/Agents/Generated/TransactionAgent.cs
@@ -1,5 +1,5 @@
/*
- * This file is automatically generated; any changes will be lost.
+ * This file is automatically generated; any changes will be lost.
*/
#nullable enable
@@ -19,7 +19,7 @@
namespace Cdr.Banking.Common.Agents
{
///
- /// Defines the Transaction Web API agent.
+ /// Defines the Web API agent.
///
public partial interface ITransactionAgent
{
@@ -27,7 +27,7 @@ public partial interface ITransactionAgent
/// Get transaction for account.
///
/// The Account Id.
- /// The Args (see ).
+ /// The Args (see ).
/// The .
/// The optional .
/// A .
@@ -35,7 +35,7 @@ public partial interface ITransactionAgent
}
///
- /// Provides the Transaction Web API agent.
+ /// Provides the Web API agent.
///
public partial class TransactionAgent : WebApiAgentBase, ITransactionAgent
{
@@ -49,15 +49,13 @@ public TransactionAgent(IWebApiAgentArgs args) : base(args) { }
/// Get transaction for account.
///
/// The Account Id.
- /// The Args (see ).
+ /// The Args (see ).
/// The .
/// The optional .
/// A .
- public Task> GetTransactionsAsync(string? accountId, TransactionArgs? args, PagingArgs? paging = null, WebApiRequestOptions? requestOptions = null)
- {
- return GetCollectionResultAsync("api/v1/banking/accounts/{accountId}/transactions", requestOptions: requestOptions,
+ public Task> GetTransactionsAsync(string? accountId, TransactionArgs? args, PagingArgs? paging = null, WebApiRequestOptions? requestOptions = null) =>
+ GetCollectionResultAsync("api/v1/banking/accounts/{accountId}/transactions", requestOptions: requestOptions,
args: new WebApiArg[] { new WebApiArg("accountId", accountId), new WebApiArg("args", args, WebApiArgType.FromUriUseProperties), new WebApiPagingArgsArg("paging", paging) });
- }
}
}
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 142dbab6d..ce6053200 100644
--- a/samples/Cdr.Banking/Cdr.Banking.Common/Entities/Generated/Account.cs
+++ b/samples/Cdr.Banking/Cdr.Banking.Common/Entities/Generated/Account.cs
@@ -43,12 +43,12 @@ public partial class Account : EntityBase, IStringIdentifier, IEquatable
/// Gets or sets the identifier.
///
- [JsonProperty("accountId", DefaultValueHandling = DefaultValueHandling.Ignore)]
+ [JsonProperty("accountId", DefaultValueHandling = DefaultValueHandling.Include)]
[Display(Name="Identifier")]
public string? Id
{
get => _id;
- set => SetValue(ref _id, value, false, StringTrim.UseDefault, StringTransform.UseDefault, nameof(Id));
+ set => SetValue(ref _id, value, false, StringTrim.UseDefault, StringTransform.UseDefault, nameof(Id));
}
///
@@ -56,11 +56,10 @@ public string? Id
///
[JsonProperty("creationDate", DefaultValueHandling = DefaultValueHandling.Ignore)]
[Display(Name="Creation Date")]
- [DisplayFormat(DataFormatString = Beef.Entities.StringFormat.DateOnlyFormat)]
public DateTime CreationDate
{
get => _creationDate;
- set => SetValue(ref _creationDate, value, false, DateTimeTransform.DateOnly, nameof(CreationDate));
+ set => SetValue(ref _creationDate, value, false, DateTimeTransform.DateOnly, nameof(CreationDate));
}
///
@@ -71,7 +70,7 @@ public DateTime CreationDate
public string? DisplayName
{
get => _displayName;
- set => SetValue(ref _displayName, value, false, StringTrim.UseDefault, StringTransform.UseDefault, nameof(DisplayName));
+ set => SetValue(ref _displayName, value, false, StringTrim.UseDefault, StringTransform.UseDefault, nameof(DisplayName));
}
///
@@ -82,7 +81,7 @@ public string? DisplayName
public string? Nickname
{
get => _nickname;
- set => SetValue(ref _nickname, value, false, StringTrim.UseDefault, StringTransform.UseDefault, nameof(Nickname));
+ set => SetValue(ref _nickname, value, false, StringTrim.UseDefault, StringTransform.UseDefault, nameof(Nickname));
}
///
@@ -108,14 +107,14 @@ public RefDataNamespace.OpenStatus? OpenStatus
}
///
- /// Gets or sets a value indicating whether Is Owned.
+ /// Indicates whether Is Owned.
///
[JsonProperty("isOwned", DefaultValueHandling = DefaultValueHandling.Ignore)]
[Display(Name="Is Owned")]
public bool IsOwned
{
get => _isOwned;
- set => SetValue(ref _isOwned, value, false, false, nameof(IsOwned));
+ set => SetValue(ref _isOwned, value, false, false, nameof(IsOwned));
}
///
@@ -126,7 +125,7 @@ public bool IsOwned
public string? MaskedNumber
{
get => _maskedNumber;
- set => SetValue(ref _maskedNumber, value, false, StringTrim.UseDefault, StringTransform.UseDefault, nameof(MaskedNumber));
+ set => SetValue(ref _maskedNumber, value, false, StringTrim.UseDefault, StringTransform.UseDefault, nameof(MaskedNumber));
}
///
@@ -159,13 +158,13 @@ public RefDataNamespace.ProductCategory? ProductCategory
public string? ProductName
{
get => _productName;
- set => SetValue(ref _productName, value, false, StringTrim.UseDefault, StringTransform.UseDefault, nameof(ProductName));
+ set => SetValue(ref _productName, value, false, StringTrim.UseDefault, StringTransform.UseDefault, nameof(ProductName));
}
#endregion
- #region UniqueKey
-
+ #region IUniqueKey
+
///
/// Indicates whether the has a value.
///
@@ -175,20 +174,17 @@ public string? ProductName
/// Gets the list of property names that represent the unique key.
///
public override string[] UniqueKeyProperties => new string[] { nameof(Id) };
-
+
///
/// Creates the .
///
/// The .
/// The .
- public static UniqueKey CreateUniqueKey(string accountId) => new UniqueKey(accountId);
-
+ public static UniqueKey CreateUniqueKey(string? accountId) => new UniqueKey(accountId);
+
///
- /// Gets the .
+ /// Gets the (consists of the following property(s): ).
///
- ///
- /// The UniqueKey key consists of the following property(s): .
- ///
public override UniqueKey UniqueKey => new UniqueKey(Id);
#endregion
@@ -200,36 +196,30 @@ public string? ProductName
///
/// The object to compare with the current object.
/// true if the specified object is equal to the current object; otherwise, false.
- public override bool Equals(object? obj)
- {
- if (!(obj is Account val))
- return false;
-
- return Equals(val);
- }
+ public override bool Equals(object? obj) => obj is Account val && Equals(val);
///
/// Determines whether the specified is equal to the current by comparing the values of all the properties.
///
- /// The object to compare with the current object.
- /// true if the specified object is equal to the current object; otherwise, false.
- public bool Equals(Account? obj)
+ /// The to compare with the current .
+ /// true if the specified is equal to the current ; otherwise, false.
+ public bool Equals(Account? value)
{
- if (obj == null)
+ if (value == null)
return false;
- else if (ReferenceEquals(obj, this))
+ else if (ReferenceEquals(value, this))
return true;
- return base.Equals((object)obj)
- && Equals(Id, obj.Id)
- && Equals(CreationDate, obj.CreationDate)
- && Equals(DisplayName, obj.DisplayName)
- && Equals(Nickname, obj.Nickname)
- && Equals(OpenStatusSid, obj.OpenStatusSid)
- && Equals(IsOwned, obj.IsOwned)
- && Equals(MaskedNumber, obj.MaskedNumber)
- && Equals(ProductCategorySid, obj.ProductCategorySid)
- && Equals(ProductName, obj.ProductName);
+ return base.Equals((object)value)
+ && Equals(Id, value.Id)
+ && Equals(CreationDate, value.CreationDate)
+ && Equals(DisplayName, value.DisplayName)
+ && Equals(Nickname, value.Nickname)
+ && Equals(OpenStatusSid, value.OpenStatusSid)
+ && Equals(IsOwned, value.IsOwned)
+ && Equals(MaskedNumber, value.MaskedNumber)
+ && Equals(ProductCategorySid, value.ProductCategorySid)
+ && Equals(ProductName, value.ProductName);
}
///
@@ -249,9 +239,9 @@ public bool Equals(Account? obj)
public static bool operator != (Account? a, Account? b) => !Equals(a, b);
///
- /// Returns a hash code for the .
+ /// Returns the hash code for the .
///
- /// A hash code for the .
+ /// The hash code for the .
public override int GetHashCode()
{
var hash = new HashCode();
@@ -268,7 +258,7 @@ public override int GetHashCode()
}
#endregion
-
+
#region ICopyFrom
///
@@ -287,8 +277,8 @@ public override void CopyFrom(object from)
/// The to copy from.
public void CopyFrom(Account from)
{
- if (from == null)
- throw new ArgumentNullException(nameof(from));
+ if (from == null)
+ throw new ArgumentNullException(nameof(from));
CopyFrom((EntityBase)from);
Id = from.Id;
@@ -303,9 +293,9 @@ public void CopyFrom(Account from)
OnAfterCopyFrom(from);
}
-
+
#endregion
-
+
#region ICloneable
///
@@ -341,7 +331,7 @@ public override void CleanUp()
OnAfterCleanUp();
}
-
+
///
/// Indicates whether considered initial; i.e. all properties have their initial value.
///
@@ -371,31 +361,27 @@ public override bool IsInitial
partial void OnAfterCopyFrom(Account from);
#endregion
- }
+ }
+
+ #region Collection
///
- /// Represents a collection.
+ /// Represents the collection.
///
[SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1402:FileMayOnlyContainASingleClass", Justification = "Tightly coupled; OK.")]
public partial class AccountCollection : EntityBaseCollection
{
- #region Constructors
-
///
/// Initializes a new instance of the class.
///
- public AccountCollection(){ }
+ public AccountCollection() { }
///
- /// Initializes a new instance of the class with an entity range.
+ /// Initializes a new instance of the class with an entities range.
///
/// The entities.
public AccountCollection(IEnumerable entities) => AddRange(entities);
- #endregion
-
- #region ICloneable
-
///
/// Creates a deep copy of the .
///
@@ -403,31 +389,29 @@ public AccountCollection(){ }
public override object Clone()
{
var clone = new AccountCollection();
- foreach (Account item in this)
+ foreach (var item in this)
{
clone.Add((Account)item.Clone());
}
return clone;
}
-
- #endregion
-
- #region Operator
///
- /// An implicit cast from a to a .
+ /// An implicit cast from the to a corresponding .
///
/// The .
/// The corresponding .
[SuppressMessage("Usage", "CA2225:Operator overloads have named alternates", Justification = "Improves useability")]
public static implicit operator AccountCollection(AccountCollectionResult result) => result?.Result!;
-
- #endregion
}
+ #endregion
+
+ #region CollectionResult
+
///
- /// Represents a collection result.
+ /// Represents the collection result.
///
[SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1402:FileMayOnlyContainASingleClass", Justification = "Tightly coupled; OK.")]
public class AccountCollectionResult : EntityCollectionResult
@@ -438,7 +422,7 @@ public class AccountCollectionResult : EntityCollectionResult
- /// Initializes a new instance of the class with default .
+ /// Initializes a new instance of the class with .
///
/// The .
public AccountCollectionResult(PagingArgs? paging) : base(paging) { }
@@ -461,6 +445,8 @@ public override object Clone()
return clone;
}
}
+
+ #endregion
}
#pragma warning restore CA2227, CA1819
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 e16b298d2..fd663b7e9 100644
--- a/samples/Cdr.Banking/Cdr.Banking.Common/Entities/Generated/AccountArgs.cs
+++ b/samples/Cdr.Banking/Cdr.Banking.Common/Entities/Generated/AccountArgs.cs
@@ -79,14 +79,14 @@ public RefDataNamespace.OpenStatus? OpenStatus
}
///
- /// Gets or sets a value indicating whether Is Owned.
+ /// Indicates whether Is Owned.
///
[JsonProperty("is-owned", DefaultValueHandling = DefaultValueHandling.Ignore)]
[Display(Name="Is Owned")]
public bool? IsOwned
{
get => _isOwned;
- set => SetValue(ref _isOwned, value, false, false, nameof(IsOwned));
+ set => SetValue(ref _isOwned, value, false, false, nameof(IsOwned));
}
#endregion
@@ -98,30 +98,24 @@ public bool? IsOwned
///
/// The object to compare with the current object.
/// true if the specified object is equal to the current object; otherwise, false.
- public override bool Equals(object? obj)
- {
- if (!(obj is AccountArgs val))
- return false;
-
- return Equals(val);
- }
+ public override bool Equals(object? obj) => obj is AccountArgs val && Equals(val);
///
/// Determines whether the specified is equal to the current by comparing the values of all the properties.
///
- /// The object to compare with the current object.
- /// true if the specified object is equal to the current object; otherwise, false.
- public bool Equals(AccountArgs? obj)
+ /// The to compare with the current .
+ /// true if the specified is equal to the current ; otherwise, false.
+ public bool Equals(AccountArgs? value)
{
- if (obj == null)
+ if (value == null)
return false;
- else if (ReferenceEquals(obj, this))
+ else if (ReferenceEquals(value, this))
return true;
- return base.Equals((object)obj)
- && Equals(ProductCategorySid, obj.ProductCategorySid)
- && Equals(OpenStatusSid, obj.OpenStatusSid)
- && Equals(IsOwned, obj.IsOwned);
+ return base.Equals((object)value)
+ && Equals(ProductCategorySid, value.ProductCategorySid)
+ && Equals(OpenStatusSid, value.OpenStatusSid)
+ && Equals(IsOwned, value.IsOwned);
}
///
@@ -141,9 +135,9 @@ public bool Equals(AccountArgs? obj)
public static bool operator != (AccountArgs? a, AccountArgs? b) => !Equals(a, b);
///
- /// Returns a hash code for the .
+ /// Returns the hash code for the .
///
- /// A hash code for the .
+ /// The hash code for the .
public override int GetHashCode()
{
var hash = new HashCode();
@@ -154,7 +148,7 @@ public override int GetHashCode()
}
#endregion
-
+
#region ICopyFrom
///
@@ -173,8 +167,8 @@ public override void CopyFrom(object from)
/// The to copy from.
public void CopyFrom(AccountArgs from)
{
- if (from == null)
- throw new ArgumentNullException(nameof(from));
+ if (from == null)
+ throw new ArgumentNullException(nameof(from));
CopyFrom((EntityBase)from);
ProductCategorySid = from.ProductCategorySid;
@@ -183,9 +177,9 @@ public void CopyFrom(AccountArgs from)
OnAfterCopyFrom(from);
}
-
+
#endregion
-
+
#region ICloneable
///
@@ -215,7 +209,7 @@ public override void CleanUp()
OnAfterCleanUp();
}
-
+
///
/// Indicates whether considered initial; i.e. all properties have their initial value.
///
@@ -239,7 +233,7 @@ public override bool IsInitial
partial void OnAfterCopyFrom(AccountArgs from);
#endregion
- }
+ }
}
#pragma warning restore CA2227, CA1819
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 705074001..75fcd88e5 100644
--- a/samples/Cdr.Banking/Cdr.Banking.Common/Entities/Generated/AccountDetail.cs
+++ b/samples/Cdr.Banking/Cdr.Banking.Common/Entities/Generated/AccountDetail.cs
@@ -22,7 +22,7 @@ namespace Cdr.Banking.Common.Entities
/// Represents the Detail entity.
///
[JsonObject(MemberSerialization = MemberSerialization.OptIn)]
- public partial class AccountDetail : Account
+ public partial class AccountDetail : Account, IEquatable
{
#region Privates
@@ -45,7 +45,7 @@ public partial class AccountDetail : Account
public string? Bsb
{
get => _bsb;
- set => SetValue(ref _bsb, value, false, StringTrim.UseDefault, StringTransform.UseDefault, nameof(Bsb));
+ set => SetValue(ref _bsb, value, false, StringTrim.UseDefault, StringTransform.UseDefault, nameof(Bsb));
}
///
@@ -56,7 +56,7 @@ public string? Bsb
public string? AccountNumber
{
get => _accountNumber;
- set => SetValue(ref _accountNumber, value, false, StringTrim.UseDefault, StringTransform.UseDefault, nameof(AccountNumber));
+ set => SetValue(ref _accountNumber, value, false, StringTrim.UseDefault, StringTransform.UseDefault, nameof(AccountNumber));
}
///
@@ -67,7 +67,7 @@ public string? AccountNumber
public string? BundleName
{
get => _bundleName;
- set => SetValue(ref _bundleName, value, false, StringTrim.UseDefault, StringTransform.UseDefault, nameof(BundleName));
+ set => SetValue(ref _bundleName, value, false, StringTrim.UseDefault, StringTransform.UseDefault, nameof(BundleName));
}
///
@@ -93,31 +93,31 @@ public RefDataNamespace.AccountUType? SpecificAccountUType
}
///
- /// Gets or sets the Term Deposit (see ).
+ /// Gets or sets the Term Deposit (see ).
///
[JsonProperty("termDeposit", DefaultValueHandling = DefaultValueHandling.Ignore)]
[Display(Name="Term Deposit")]
public TermDepositAccount? TermDeposit
{
get => _termDeposit;
- set => SetValue(ref _termDeposit, value, false, true, nameof(TermDeposit));
+ set => SetValue(ref _termDeposit, value, false, true, nameof(TermDeposit));
}
///
- /// Gets or sets the Credit Card (see ).
+ /// Gets or sets the Credit Card (see ).
///
[JsonProperty("creditCard", DefaultValueHandling = DefaultValueHandling.Ignore)]
[Display(Name="Credit Card")]
public CreditCardAccount? CreditCard
{
get => _creditCard;
- set => SetValue(ref _creditCard, value, false, true, nameof(CreditCard));
+ set => SetValue(ref _creditCard, value, false, true, nameof(CreditCard));
}
#endregion
#region IChangeTracking
-
+
///
/// Resets the entity state to unchanged by accepting the changes (resets ).
///
@@ -148,33 +148,27 @@ public override void TrackChanges()
///
/// The object to compare with the current object.
/// true if the specified object is equal to the current object; otherwise, false.
- public override bool Equals(object? obj)
- {
- if (!(obj is AccountDetail val))
- return false;
-
- return Equals(val);
- }
+ public override bool Equals(object? obj) => obj is AccountDetail val && Equals(val);
///
/// Determines whether the specified is equal to the current by comparing the values of all the properties.
///
- /// The object to compare with the current object.
- /// true if the specified object is equal to the current object; otherwise, false.
- public bool Equals(AccountDetail? obj)
+ /// The to compare with the current .
+ /// true if the specified is equal to the current ; otherwise, false.
+ public bool Equals(AccountDetail? value)
{
- if (obj == null)
+ if (value == null)
return false;
- else if (ReferenceEquals(obj, this))
+ else if (ReferenceEquals(value, this))
return true;
- return base.Equals((object)obj)
- && Equals(Bsb, obj.Bsb)
- && Equals(AccountNumber, obj.AccountNumber)
- && Equals(BundleName, obj.BundleName)
- && Equals(SpecificAccountUTypeSid, obj.SpecificAccountUTypeSid)
- && Equals(TermDeposit, obj.TermDeposit)
- && Equals(CreditCard, obj.CreditCard);
+ return base.Equals((object)value)
+ && Equals(Bsb, value.Bsb)
+ && Equals(AccountNumber, value.AccountNumber)
+ && Equals(BundleName, value.BundleName)
+ && Equals(SpecificAccountUTypeSid, value.SpecificAccountUTypeSid)
+ && Equals(TermDeposit, value.TermDeposit)
+ && Equals(CreditCard, value.CreditCard);
}
///
@@ -194,9 +188,9 @@ public bool Equals(AccountDetail? obj)
public static bool operator != (AccountDetail? a, AccountDetail? b) => !Equals(a, b);
///
- /// Returns a hash code for the .
+ /// Returns the hash code for the .
///
- /// A hash code for the .
+ /// The hash code for the .
public override int GetHashCode()
{
var hash = new HashCode();
@@ -210,7 +204,7 @@ public override int GetHashCode()
}
#endregion
-
+
#region ICopyFrom
///
@@ -229,8 +223,8 @@ public override void CopyFrom(object from)
/// The to copy from.
public void CopyFrom(AccountDetail from)
{
- if (from == null)
- throw new ArgumentNullException(nameof(from));
+ if (from == null)
+ throw new ArgumentNullException(nameof(from));
CopyFrom((Account)from);
Bsb = from.Bsb;
@@ -242,9 +236,9 @@ public void CopyFrom(AccountDetail from)
OnAfterCopyFrom(from);
}
-
+
#endregion
-
+
#region ICloneable
///
@@ -277,7 +271,7 @@ public override void CleanUp()
OnAfterCleanUp();
}
-
+
///
/// Indicates whether considered initial; i.e. all properties have their initial value.
///
@@ -307,7 +301,7 @@ public override bool IsInitial
partial void OnAfterCopyFrom(AccountDetail from);
#endregion
- }
+ }
}
#pragma warning restore CA2227, CA1819
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 85286c42a..617b26a06 100644
--- a/samples/Cdr.Banking/Cdr.Banking.Common/Entities/Generated/AccountUType.cs
+++ b/samples/Cdr.Banking/Cdr.Banking.Common/Entities/Generated/AccountUType.cs
@@ -33,10 +33,7 @@ public partial class AccountUType : ReferenceDataBaseGuid
/// The Id.
/// The corresponding .
[SuppressMessage("Usage", "CA2225:Operator overloads have named alternates", Justification = "Improves useability")]
- public static implicit operator AccountUType(Guid id)
- {
- return ConvertFromId(id);
- }
+ public static implicit operator AccountUType(Guid id) => ConvertFromId(id);
///
/// An implicit cast from a Code to a .
@@ -44,13 +41,10 @@ public static implicit operator AccountUType(Guid id)
/// The Code.
/// The corresponding .
[SuppressMessage("Usage", "CA2225:Operator overloads have named alternates", Justification = "Improves useability")]
- public static implicit operator AccountUType(string? code)
- {
- return ConvertFromCode(code);
- }
+ public static implicit operator AccountUType(string? code) => ConvertFromCode(code);
#endregion
-
+
#region ICopyFrom
///
@@ -69,16 +63,16 @@ public override void CopyFrom(object from)
/// The to copy from.
public void CopyFrom(AccountUType from)
{
- if (from == null)
- throw new ArgumentNullException(nameof(from));
+ if (from == null)
+ throw new ArgumentNullException(nameof(from));
CopyFrom((ReferenceDataBaseGuid)from);
OnAfterCopyFrom(from);
}
-
+
#endregion
-
+
#region ICloneable
///
@@ -105,7 +99,7 @@ public override void CleanUp()
OnAfterCleanUp();
}
-
+
///
/// Indicates whether considered initial; i.e. all properties have their initial value.
///
@@ -130,29 +124,29 @@ public override bool IsInitial
partial void OnAfterCopyFrom(AccountUType from);
#endregion
- }
+ }
+
+ #region Collection
///
- /// Represents a collection.
+ /// Represents the collection.
///
[SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1402:FileMayOnlyContainASingleClass", Justification = "Tightly coupled; OK.")]
public partial class AccountUTypeCollection : ReferenceDataCollectionBase
{
- #region Constructors
-
///
/// Initializes a new instance of the class.
///
- public AccountUTypeCollection(){ }
+ public AccountUTypeCollection() { }
///
- /// Initializes a new instance of the class with an entity range.
+ /// Initializes a new instance of the class with an entities range.
///
/// The entities.
public AccountUTypeCollection(IEnumerable entities) => AddRange(entities);
-
- #endregion
}
+
+ #endregion
}
#pragma warning restore CA2227, CA1819
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 9ff028dc9..299fbda76 100644
--- a/samples/Cdr.Banking/Cdr.Banking.Common/Entities/Generated/Balance.cs
+++ b/samples/Cdr.Banking/Cdr.Banking.Common/Entities/Generated/Balance.cs
@@ -46,7 +46,7 @@ public partial class Balance : EntityBase, IStringIdentifier, IEquatable _id;
- set => SetValue(ref _id, value, false, StringTrim.UseDefault, StringTransform.UseDefault, nameof(Id));
+ set => SetValue(ref _id, value, false, StringTrim.UseDefault, StringTransform.UseDefault, nameof(Id));
}
///
@@ -57,7 +57,7 @@ public string? Id
public decimal CurrentBalance
{
get => _currentBalance;
- set => SetValue(ref _currentBalance, value, false, false, nameof(CurrentBalance));
+ set => SetValue(ref _currentBalance, value, false, false, nameof(CurrentBalance));
}
///
@@ -68,7 +68,7 @@ public decimal CurrentBalance
public decimal AvailableBalance
{
get => _availableBalance;
- set => SetValue(ref _availableBalance, value, false, false, nameof(AvailableBalance));
+ set => SetValue(ref _availableBalance, value, false, false, nameof(AvailableBalance));
}
///
@@ -79,7 +79,7 @@ public decimal AvailableBalance
public decimal CreditLimit
{
get => _creditLimit;
- set => SetValue(ref _creditLimit, value, false, false, nameof(CreditLimit));
+ set => SetValue(ref _creditLimit, value, false, false, nameof(CreditLimit));
}
///
@@ -90,7 +90,7 @@ public decimal CreditLimit
public decimal AmortisedLimit
{
get => _amortisedLimit;
- set => SetValue(ref _amortisedLimit, value, false, false, nameof(AmortisedLimit));
+ set => SetValue(ref _amortisedLimit, value, false, false, nameof(AmortisedLimit));
}
///
@@ -101,24 +101,24 @@ public decimal AmortisedLimit
public string? Currency
{
get => _currency;
- set => SetValue(ref _currency, value, false, StringTrim.UseDefault, StringTransform.UseDefault, nameof(Currency));
+ set => SetValue(ref _currency, value, false, StringTrim.UseDefault, StringTransform.UseDefault, nameof(Currency));
}
///
- /// Gets or sets the Purses (see ).
+ /// Gets or sets the Purses.
///
[JsonProperty("purses", DefaultValueHandling = DefaultValueHandling.Ignore)]
[Display(Name="Purses")]
public BalancePurseCollection? Purses
{
get => _purses;
- set => SetValue(ref _purses, value, false, true, nameof(Purses));
+ set => SetValue(ref _purses, value, false, true, nameof(Purses));
}
#endregion
#region IChangeTracking
-
+
///
/// Resets the entity state to unchanged by accepting the changes (resets ).
///
@@ -147,34 +147,28 @@ public override void TrackChanges()
///
/// The object to compare with the current object.
/// true if the specified object is equal to the current object; otherwise, false.
- public override bool Equals(object? obj)
- {
- if (!(obj is Balance val))
- return false;
-
- return Equals(val);
- }
+ public override bool Equals(object? obj) => obj is Balance val && Equals(val);
///
/// Determines whether the specified is equal to the current by comparing the values of all the properties.
///
- /// The object to compare with the current object.
- /// true if the specified object is equal to the current object; otherwise, false.
- public bool Equals(Balance? obj)
+ /// The to compare with the current .
+ /// true if the specified is equal to the current ; otherwise, false.
+ public bool Equals(Balance? value)
{
- if (obj == null)
+ if (value == null)
return false;
- else if (ReferenceEquals(obj, this))
+ else if (ReferenceEquals(value, this))
return true;
- return base.Equals((object)obj)
- && Equals(Id, obj.Id)
- && Equals(CurrentBalance, obj.CurrentBalance)
- && Equals(AvailableBalance, obj.AvailableBalance)
- && Equals(CreditLimit, obj.CreditLimit)
- && Equals(AmortisedLimit, obj.AmortisedLimit)
- && Equals(Currency, obj.Currency)
- && Equals(Purses, obj.Purses);
+ return base.Equals((object)value)
+ && Equals(Id, value.Id)
+ && Equals(CurrentBalance, value.CurrentBalance)
+ && Equals(AvailableBalance, value.AvailableBalance)
+ && Equals(CreditLimit, value.CreditLimit)
+ && Equals(AmortisedLimit, value.AmortisedLimit)
+ && Equals(Currency, value.Currency)
+ && Equals(Purses, value.Purses);
}
///
@@ -194,9 +188,9 @@ public bool Equals(Balance? obj)
public static bool operator != (Balance? a, Balance? b) => !Equals(a, b);
///
- /// Returns a hash code for the .
+ /// Returns the hash code for the .
///
- /// A hash code for the .
+ /// The hash code for the .
public override int GetHashCode()
{
var hash = new HashCode();
@@ -211,7 +205,7 @@ public override int GetHashCode()
}
#endregion
-
+
#region ICopyFrom
///
@@ -230,8 +224,8 @@ public override void CopyFrom(object from)
/// The to copy from.
public void CopyFrom(Balance from)
{
- if (from == null)
- throw new ArgumentNullException(nameof(from));
+ if (from == null)
+ throw new ArgumentNullException(nameof(from));
CopyFrom((EntityBase)from);
Id = from.Id;
@@ -244,9 +238,9 @@ public void CopyFrom(Balance from)
OnAfterCopyFrom(from);
}
-
+
#endregion
-
+
#region ICloneable
///
@@ -280,7 +274,7 @@ public override void CleanUp()
OnAfterCleanUp();
}
-
+
///
/// Indicates whether considered initial; i.e. all properties have their initial value.
///
@@ -308,7 +302,7 @@ public override bool IsInitial
partial void OnAfterCopyFrom(Balance from);
#endregion
- }
+ }
}
#pragma warning restore CA2227, CA1819
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 c7059bb09..b56be20df 100644
--- a/samples/Cdr.Banking/Cdr.Banking.Common/Entities/Generated/BalancePurse.cs
+++ b/samples/Cdr.Banking/Cdr.Banking.Common/Entities/Generated/BalancePurse.cs
@@ -41,7 +41,7 @@ public partial class BalancePurse : EntityBase, IEquatable
public decimal Amount
{
get => _amount;
- set => SetValue(ref _amount, value, false, false, nameof(Amount));
+ set => SetValue(ref _amount, value, false, false, nameof(Amount));
}
///
@@ -52,7 +52,7 @@ public decimal Amount
public string? Currency
{
get => _currency;
- set => SetValue(ref _currency, value, false, StringTrim.UseDefault, StringTransform.UseDefault, nameof(Currency));
+ set => SetValue(ref _currency, value, false, StringTrim.UseDefault, StringTransform.UseDefault, nameof(Currency));
}
#endregion
@@ -64,29 +64,23 @@ public string? Currency
///
/// The object to compare with the current object.
/// true if the specified object is equal to the current object; otherwise, false.
- public override bool Equals(object? obj)
- {
- if (!(obj is BalancePurse val))
- return false;
-
- return Equals(val);
- }
+ public override bool Equals(object? obj) => obj is BalancePurse val && Equals(val);
///
/// Determines whether the specified is equal to the current by comparing the values of all the properties.
///
- /// The object to compare with the current object.
- /// true if the specified object is equal to the current object; otherwise, false.
- public bool Equals(BalancePurse? obj)
+ /// The to compare with the current .
+ /// true if the specified is equal to the current ; otherwise, false.
+ public bool Equals(BalancePurse? value)
{
- if (obj == null)
+ if (value == null)
return false;
- else if (ReferenceEquals(obj, this))
+ else if (ReferenceEquals(value, this))
return true;
- return base.Equals((object)obj)
- && Equals(Amount, obj.Amount)
- && Equals(Currency, obj.Currency);
+ return base.Equals((object)value)
+ && Equals(Amount, value.Amount)
+ && Equals(Currency, value.Currency);
}
///
@@ -106,9 +100,9 @@ public bool Equals(BalancePurse? obj)
public static bool operator != (BalancePurse? a, BalancePurse? b) => !Equals(a, b);
///
- /// Returns a hash code for the .
+ /// Returns the hash code for the .
///
- /// A hash code for the .
+ /// The hash code for the .
public override int GetHashCode()
{
var hash = new HashCode();
@@ -118,7 +112,7 @@ public override int GetHashCode()
}
#endregion
-
+
#region ICopyFrom
///
@@ -137,8 +131,8 @@ public override void CopyFrom(object from)
/// The to copy from.
public void CopyFrom(BalancePurse from)
{
- if (from == null)
- throw new ArgumentNullException(nameof(from));
+ if (from == null)
+ throw new ArgumentNullException(nameof(from));
CopyFrom((EntityBase)from);
Amount = from.Amount;
@@ -146,9 +140,9 @@ public void CopyFrom(BalancePurse from)
OnAfterCopyFrom(from);
}
-
+
#endregion
-
+
#region ICloneable
///
@@ -177,7 +171,7 @@ public override void CleanUp()
OnAfterCleanUp();
}
-
+
///
/// Indicates whether considered initial; i.e. all properties have their initial value.
///
@@ -200,31 +194,27 @@ public override bool IsInitial
partial void OnAfterCopyFrom(BalancePurse from);
#endregion
- }
+ }
+
+ #region Collection
///
- /// Represents a collection.
+ /// Represents the collection.
///
[SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1402:FileMayOnlyContainASingleClass", Justification = "Tightly coupled; OK.")]
public partial class BalancePurseCollection : EntityBaseCollection
{
- #region Constructors
-
///
/// Initializes a new instance of the class.
///
- public BalancePurseCollection(){ }
+ public BalancePurseCollection() { }
///
- /// Initializes a new instance of the class with an entity range.
+ /// Initializes a new instance of the class with an entities range.
///
/// The entities.
public BalancePurseCollection(IEnumerable entities) => AddRange(entities);
- #endregion
-
- #region ICloneable
-
///
/// Creates a deep copy of the .
///
@@ -232,16 +222,16 @@ public BalancePurseCollection(){ }
public override object Clone()
{
var clone = new BalancePurseCollection();
- foreach (BalancePurse item in this)
+ foreach (var item in this)
{
clone.Add((BalancePurse)item.Clone());
}
return clone;
}
-
- #endregion
}
+
+ #endregion
}
#pragma warning restore CA2227, CA1819
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 f1aa9969e..006a7fd9c 100644
--- a/samples/Cdr.Banking/Cdr.Banking.Common/Entities/Generated/CreditCardAccount.cs
+++ b/samples/Cdr.Banking/Cdr.Banking.Common/Entities/Generated/CreditCardAccount.cs
@@ -43,7 +43,7 @@ public partial class CreditCardAccount : EntityBase, IEquatable _minPaymentAmount;
- set => SetValue(ref _minPaymentAmount, value, false, false, nameof(MinPaymentAmount));
+ set => SetValue(ref _minPaymentAmount, value, false, false, nameof(MinPaymentAmount));
}
///
@@ -54,7 +54,7 @@ public decimal MinPaymentAmount
public decimal PaymentDueAmount
{
get => _paymentDueAmount;
- set => SetValue(ref _paymentDueAmount, value, false, false, nameof(PaymentDueAmount));
+ set => SetValue(ref _paymentDueAmount, value, false, false, nameof(PaymentDueAmount));
}
///
@@ -65,7 +65,7 @@ public decimal PaymentDueAmount
public string? PaymentCurrency
{
get => _paymentCurrency;
- set => SetValue(ref _paymentCurrency, value, false, StringTrim.UseDefault, StringTransform.UseDefault, nameof(PaymentCurrency));
+ set => SetValue(ref _paymentCurrency, value, false, StringTrim.UseDefault, StringTransform.UseDefault, nameof(PaymentCurrency));
}
///
@@ -73,11 +73,10 @@ public string? PaymentCurrency
///
[JsonProperty("paymentDueDate", DefaultValueHandling = DefaultValueHandling.Ignore)]
[Display(Name="Payment Due Date")]
- [DisplayFormat(DataFormatString = Beef.Entities.StringFormat.DateOnlyFormat)]
public DateTime PaymentDueDate
{
get => _paymentDueDate;
- set => SetValue(ref _paymentDueDate, value, false, DateTimeTransform.DateOnly, nameof(PaymentDueDate));
+ set => SetValue(ref _paymentDueDate, value, false, DateTimeTransform.DateOnly, nameof(PaymentDueDate));
}
#endregion
@@ -89,31 +88,25 @@ public DateTime PaymentDueDate
///
/// The object to compare with the current object.
/// true if the specified object is equal to the current object; otherwise, false.
- public override bool Equals(object? obj)
- {
- if (!(obj is CreditCardAccount val))
- return false;
-
- return Equals(val);
- }
+ public override bool Equals(object? obj) => obj is CreditCardAccount val && Equals(val);
///
/// Determines whether the specified is equal to the current by comparing the values of all the properties.
///
- /// The object to compare with the current object.
- /// true if the specified object is equal to the current object; otherwise, false.
- public bool Equals(CreditCardAccount? obj)
+ /// The to compare with the current .
+ /// true if the specified is equal to the current ; otherwise, false.
+ public bool Equals(CreditCardAccount? value)
{
- if (obj == null)
+ if (value == null)
return false;
- else if (ReferenceEquals(obj, this))
+ else if (ReferenceEquals(value, this))
return true;
- return base.Equals((object)obj)
- && Equals(MinPaymentAmount, obj.MinPaymentAmount)
- && Equals(PaymentDueAmount, obj.PaymentDueAmount)
- && Equals(PaymentCurrency, obj.PaymentCurrency)
- && Equals(PaymentDueDate, obj.PaymentDueDate);
+ return base.Equals((object)value)
+ && Equals(MinPaymentAmount, value.MinPaymentAmount)
+ && Equals(PaymentDueAmount, value.PaymentDueAmount)
+ && Equals(PaymentCurrency, value.PaymentCurrency)
+ && Equals(PaymentDueDate, value.PaymentDueDate);
}
///
@@ -133,9 +126,9 @@ public bool Equals(CreditCardAccount? obj)
public static bool operator != (CreditCardAccount? a, CreditCardAccount? b) => !Equals(a, b);
///
- /// Returns a hash code for the .
+ /// Returns the hash code for the .
///
- /// A hash code for the .
+ /// The hash code for the .
public override int GetHashCode()
{
var hash = new HashCode();
@@ -147,7 +140,7 @@ public override int GetHashCode()
}
#endregion
-
+
#region ICopyFrom
///
@@ -166,8 +159,8 @@ public override void CopyFrom(object from)
/// The to copy from.
public void CopyFrom(CreditCardAccount from)
{
- if (from == null)
- throw new ArgumentNullException(nameof(from));
+ if (from == null)
+ throw new ArgumentNullException(nameof(from));
CopyFrom((EntityBase)from);
MinPaymentAmount = from.MinPaymentAmount;
@@ -177,9 +170,9 @@ public void CopyFrom(CreditCardAccount from)
OnAfterCopyFrom(from);
}
-
+
#endregion
-
+
#region ICloneable
///
@@ -210,7 +203,7 @@ public override void CleanUp()
OnAfterCleanUp();
}
-
+
///
/// Indicates whether considered initial; i.e. all properties have their initial value.
///
@@ -235,7 +228,7 @@ public override bool IsInitial
partial void OnAfterCopyFrom(CreditCardAccount from);
#endregion
- }
+ }
}
#pragma warning restore CA2227, CA1819
diff --git a/samples/Cdr.Banking/Cdr.Banking.Common/Entities/Generated/IReferenceData.cs b/samples/Cdr.Banking/Cdr.Banking.Common/Entities/Generated/IReferenceData.cs
index 8548d0051..d7ddcbc63 100644
--- a/samples/Cdr.Banking/Cdr.Banking.Common/Entities/Generated/IReferenceData.cs
+++ b/samples/Cdr.Banking/Cdr.Banking.Common/Entities/Generated/IReferenceData.cs
@@ -14,7 +14,7 @@ namespace Cdr.Banking.Common.Entities
///
/// Provides for the required ReferenceData capabilities.
///
- public interface IReferenceData : IReferenceDataProvider
+ public partial interface IReferenceData : IReferenceDataProvider
{
#region Collections
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 702d9067a..327bab0f2 100644
--- a/samples/Cdr.Banking/Cdr.Banking.Common/Entities/Generated/MaturityInstructions.cs
+++ b/samples/Cdr.Banking/Cdr.Banking.Common/Entities/Generated/MaturityInstructions.cs
@@ -33,10 +33,7 @@ public partial class MaturityInstructions : ReferenceDataBaseGuid
/// The Id.
/// The corresponding .
[SuppressMessage("Usage", "CA2225:Operator overloads have named alternates", Justification = "Improves useability")]
- public static implicit operator MaturityInstructions(Guid id)
- {
- return ConvertFromId(id);
- }
+ public static implicit operator MaturityInstructions(Guid id) => ConvertFromId(id);
///
/// An implicit cast from a Code to a .
@@ -44,13 +41,10 @@ public static implicit operator MaturityInstructions(Guid id)
/// The Code.
/// The corresponding .
[SuppressMessage("Usage", "CA2225:Operator overloads have named alternates", Justification = "Improves useability")]
- public static implicit operator MaturityInstructions(string? code)
- {
- return ConvertFromCode(code);
- }
+ public static implicit operator MaturityInstructions(string? code) => ConvertFromCode(code);
#endregion
-
+
#region ICopyFrom
///
@@ -69,16 +63,16 @@ public override void CopyFrom(object from)
/// The to copy from.
public void CopyFrom(MaturityInstructions from)
{
- if (from == null)
- throw new ArgumentNullException(nameof(from));
+ if (from == null)
+ throw new ArgumentNullException(nameof(from));
CopyFrom((ReferenceDataBaseGuid)from);
OnAfterCopyFrom(from);
}
-
+
#endregion
-
+
#region ICloneable
///
@@ -105,7 +99,7 @@ public override void CleanUp()
OnAfterCleanUp();
}
-
+
///
/// Indicates whether considered initial; i.e. all properties have their initial value.
///
@@ -130,29 +124,29 @@ public override bool IsInitial
partial void OnAfterCopyFrom(MaturityInstructions from);
#endregion
- }
+ }
+
+ #region Collection
///
- /// Represents a collection.
+ /// Represents the collection.
///
[SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1402:FileMayOnlyContainASingleClass", Justification = "Tightly coupled; OK.")]
public partial class MaturityInstructionsCollection : ReferenceDataCollectionBase
{
- #region Constructors
-
///
/// Initializes a new instance of the class.
///
- public MaturityInstructionsCollection(){ }
+ public MaturityInstructionsCollection() { }
///
- /// Initializes a new instance of the class with an entity range.
+ /// Initializes a new instance of the class with an entities range.
///
/// The entities.
public MaturityInstructionsCollection(IEnumerable entities) => AddRange(entities);
-
- #endregion
}
+
+ #endregion
}
#pragma warning restore CA2227, CA1819
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 1980a5636..bb9536f34 100644
--- a/samples/Cdr.Banking/Cdr.Banking.Common/Entities/Generated/OpenStatus.cs
+++ b/samples/Cdr.Banking/Cdr.Banking.Common/Entities/Generated/OpenStatus.cs
@@ -42,10 +42,7 @@ public partial class OpenStatus : ReferenceDataBaseGuid
/// The Id.
/// The corresponding .
[SuppressMessage("Usage", "CA2225:Operator overloads have named alternates", Justification = "Improves useability")]
- public static implicit operator OpenStatus(Guid id)
- {
- return ConvertFromId(id);
- }
+ public static implicit operator OpenStatus(Guid id) => ConvertFromId(id);
///
/// An implicit cast from a Code to a .
@@ -53,13 +50,10 @@ public static implicit operator OpenStatus(Guid id)
/// The Code.
/// The corresponding .
[SuppressMessage("Usage", "CA2225:Operator overloads have named alternates", Justification = "Improves useability")]
- public static implicit operator OpenStatus(string? code)
- {
- return ConvertFromCode(code);
- }
+ public static implicit operator OpenStatus(string? code) => ConvertFromCode(code);
#endregion
-
+
#region ICopyFrom
///
@@ -78,16 +72,16 @@ public override void CopyFrom(object from)
/// The to copy from.
public void CopyFrom(OpenStatus from)
{
- if (from == null)
- throw new ArgumentNullException(nameof(from));
+ if (from == null)
+ throw new ArgumentNullException(nameof(from));
CopyFrom((ReferenceDataBaseGuid)from);
OnAfterCopyFrom(from);
}
-
+
#endregion
-
+
#region ICloneable
///
@@ -114,7 +108,7 @@ public override void CleanUp()
OnAfterCleanUp();
}
-
+
///
/// Indicates whether considered initial; i.e. all properties have their initial value.
///
@@ -139,29 +133,29 @@ public override bool IsInitial
partial void OnAfterCopyFrom(OpenStatus from);
#endregion
- }
+ }
+
+ #region Collection
///
- /// Represents a collection.
+ /// Represents the collection.
///
[SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1402:FileMayOnlyContainASingleClass", Justification = "Tightly coupled; OK.")]
public partial class OpenStatusCollection : ReferenceDataCollectionBase
{
- #region Constructors
-
///
/// Initializes a new instance of the class.
///
- public OpenStatusCollection(){ }
+ public OpenStatusCollection() { }
///
- /// Initializes a new instance of the class with an entity range.
+ /// Initializes a new instance of the class with an entities range.
///
/// The entities.
public OpenStatusCollection(IEnumerable entities) => AddRange(entities);
-
- #endregion
}
+
+ #endregion
}
#pragma warning restore CA2227, CA1819
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 53fce3460..418731d91 100644
--- a/samples/Cdr.Banking/Cdr.Banking.Common/Entities/Generated/ProductCategory.cs
+++ b/samples/Cdr.Banking/Cdr.Banking.Common/Entities/Generated/ProductCategory.cs
@@ -33,10 +33,7 @@ public partial class ProductCategory : ReferenceDataBaseGuid
/// The Id.
/// The corresponding .
[SuppressMessage("Usage", "CA2225:Operator overloads have named alternates", Justification = "Improves useability")]
- public static implicit operator ProductCategory(Guid id)
- {
- return ConvertFromId(id);
- }
+ public static implicit operator ProductCategory(Guid id) => ConvertFromId(id);
///
/// An implicit cast from a Code to a .
@@ -44,13 +41,10 @@ public static implicit operator ProductCategory(Guid id)
/// The Code.
/// The corresponding .
[SuppressMessage("Usage", "CA2225:Operator overloads have named alternates", Justification = "Improves useability")]
- public static implicit operator ProductCategory(string? code)
- {
- return ConvertFromCode(code);
- }
+ public static implicit operator ProductCategory(string? code) => ConvertFromCode(code);
#endregion
-
+
#region ICopyFrom
///
@@ -69,16 +63,16 @@ public override void CopyFrom(object from)
/// The to copy from.
public void CopyFrom(ProductCategory from)
{
- if (from == null)
- throw new ArgumentNullException(nameof(from));
+ if (from == null)
+ throw new ArgumentNullException(nameof(from));
CopyFrom((ReferenceDataBaseGuid)from);
OnAfterCopyFrom(from);
}
-
+
#endregion
-
+
#region ICloneable
///
@@ -105,7 +99,7 @@ public override void CleanUp()
OnAfterCleanUp();
}
-
+
///
/// Indicates whether considered initial; i.e. all properties have their initial value.
///
@@ -130,29 +124,29 @@ public override bool IsInitial
partial void OnAfterCopyFrom(ProductCategory from);
#endregion
- }
+ }
+
+ #region Collection
///
- /// Represents a collection.
+ /// Represents the collection.
///
[SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1402:FileMayOnlyContainASingleClass", Justification = "Tightly coupled; OK.")]
public partial class ProductCategoryCollection : ReferenceDataCollectionBase
{
- #region Constructors
-
///
/// Initializes a new instance of the class.
///
- public ProductCategoryCollection(){ }
+ public ProductCategoryCollection() { }
///
- /// Initializes a new instance of the class with an entity range.
+ /// Initializes a new instance of the class with an entities range.
///
/// The entities.
public ProductCategoryCollection(IEnumerable entities) => AddRange(entities);
-
- #endregion
}
+
+ #endregion
}
#pragma warning restore CA2227, CA1819
diff --git a/samples/Cdr.Banking/Cdr.Banking.Common/Entities/Generated/ReferenceData.cs b/samples/Cdr.Banking/Cdr.Banking.Common/Entities/Generated/ReferenceData.cs
index 4beea3e24..8986e51b4 100644
--- a/samples/Cdr.Banking/Cdr.Banking.Common/Entities/Generated/ReferenceData.cs
+++ b/samples/Cdr.Banking/Cdr.Banking.Common/Entities/Generated/ReferenceData.cs
@@ -35,7 +35,7 @@ public abstract partial class ReferenceData : IReferenceData
typeof(TransactionType),
typeof(TransactionStatus)
};
-
+
///
/// Gets the provider interface cref="Type"/> used for . The value is .
///
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 c02bd1f94..e3e37d4d5 100644
--- a/samples/Cdr.Banking/Cdr.Banking.Common/Entities/Generated/TermDepositAccount.cs
+++ b/samples/Cdr.Banking/Cdr.Banking.Common/Entities/Generated/TermDepositAccount.cs
@@ -41,11 +41,10 @@ public partial class TermDepositAccount : EntityBase, IEquatable
[JsonProperty("lodgementDate", DefaultValueHandling = DefaultValueHandling.Ignore)]
[Display(Name="Lodgement Date")]
- [DisplayFormat(DataFormatString = Beef.Entities.StringFormat.DateOnlyFormat)]
public DateTime LodgementDate
{
get => _lodgementDate;
- set => SetValue(ref _lodgementDate, value, false, DateTimeTransform.DateOnly, nameof(LodgementDate));
+ set => SetValue(ref _lodgementDate, value, false, DateTimeTransform.DateOnly, nameof(LodgementDate));
}
///
@@ -53,11 +52,10 @@ public DateTime LodgementDate
///
[JsonProperty("maturityDate", DefaultValueHandling = DefaultValueHandling.Ignore)]
[Display(Name="Maturity Date")]
- [DisplayFormat(DataFormatString = Beef.Entities.StringFormat.DateOnlyFormat)]
public DateTime MaturityDate
{
get => _maturityDate;
- set => SetValue(ref _maturityDate, value, false, DateTimeTransform.DateOnly, nameof(MaturityDate));
+ set => SetValue(ref _maturityDate, value, false, DateTimeTransform.DateOnly, nameof(MaturityDate));
}
///
@@ -68,7 +66,7 @@ public DateTime MaturityDate
public decimal MaturityAmount
{
get => _maturityAmount;
- set => SetValue(ref _maturityAmount, value, false, false, nameof(MaturityAmount));
+ set => SetValue(ref _maturityAmount, value, false, false, nameof(MaturityAmount));
}
///
@@ -79,7 +77,7 @@ public decimal MaturityAmount
public string? MaturityCurrency
{
get => _maturityCurrency;
- set => SetValue(ref _maturityCurrency, value, false, StringTrim.UseDefault, StringTransform.UseDefault, nameof(MaturityCurrency));
+ set => SetValue(ref _maturityCurrency, value, false, StringTrim.UseDefault, StringTransform.UseDefault, nameof(MaturityCurrency));
}
///
@@ -113,32 +111,26 @@ public RefDataNamespace.MaturityInstructions? MaturityInstructions
///
/// The object to compare with the current object.
/// true if the specified object is equal to the current object; otherwise, false.
- public override bool Equals(object? obj)
- {
- if (!(obj is TermDepositAccount val))
- return false;
-
- return Equals(val);
- }
+ public override bool Equals(object? obj) => obj is TermDepositAccount val && Equals(val);
///
/// Determines whether the specified is equal to the current by comparing the values of all the properties.
///
- /// The object to compare with the current object.
- /// true if the specified object is equal to the current object; otherwise, false.
- public bool Equals(TermDepositAccount? obj)
+ /// The to compare with the current .
+ /// true if the specified is equal to the current ; otherwise, false.
+ public bool Equals(TermDepositAccount? value)
{
- if (obj == null)
+ if (value == null)
return false;
- else if (ReferenceEquals(obj, this))
+ else if (ReferenceEquals(value, this))
return true;
- return base.Equals((object)obj)
- && Equals(LodgementDate, obj.LodgementDate)
- && Equals(MaturityDate, obj.MaturityDate)
- && Equals(MaturityAmount, obj.MaturityAmount)
- && Equals(MaturityCurrency, obj.MaturityCurrency)
- && Equals(MaturityInstructionsSid, obj.MaturityInstructionsSid);
+ return base.Equals((object)value)
+ && Equals(LodgementDate, value.LodgementDate)
+ && Equals(MaturityDate, value.MaturityDate)
+ && Equals(MaturityAmount, value.MaturityAmount)
+ && Equals(MaturityCurrency, value.MaturityCurrency)
+ && Equals(MaturityInstructionsSid, value.MaturityInstructionsSid);
}
///
@@ -158,9 +150,9 @@ public bool Equals(TermDepositAccount? obj)
public static bool operator != (TermDepositAccount? a, TermDepositAccount? b) => !Equals(a, b);
///
- /// Returns a hash code for the .
+ /// Returns the hash code for the .
///
- /// A hash code for the .
+ /// The hash code for the .
public override int GetHashCode()
{
var hash = new HashCode();
@@ -173,7 +165,7 @@ public override int GetHashCode()
}
#endregion
-
+
#region ICopyFrom
///
@@ -192,8 +184,8 @@ public override void CopyFrom(object from)
/// The to copy from.
public void CopyFrom(TermDepositAccount from)
{
- if (from == null)
- throw new ArgumentNullException(nameof(from));
+ if (from == null)
+ throw new ArgumentNullException(nameof(from));
CopyFrom((EntityBase)from);
LodgementDate = from.LodgementDate;
@@ -204,9 +196,9 @@ public void CopyFrom(TermDepositAccount from)
OnAfterCopyFrom(from);
}
-
+
#endregion
-
+
#region ICloneable
///
@@ -238,7 +230,7 @@ public override void CleanUp()
OnAfterCleanUp();
}
-
+
///
/// Indicates whether considered initial; i.e. all properties have their initial value.
///
@@ -264,7 +256,7 @@ public override bool IsInitial
partial void OnAfterCopyFrom(TermDepositAccount from);
#endregion
- }
+ }
}
#pragma warning restore CA2227, CA1819
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 3b06e6402..d836d0b91 100644
--- a/samples/Cdr.Banking/Cdr.Banking.Common/Entities/Generated/Transaction.cs
+++ b/samples/Cdr.Banking/Cdr.Banking.Common/Entities/Generated/Transaction.cs
@@ -50,12 +50,12 @@ public partial class Transaction : EntityBase, IStringIdentifier, IEquatable
/// Gets or sets the identifier.
///
- [JsonProperty("transactionId", DefaultValueHandling = DefaultValueHandling.Ignore)]
+ [JsonProperty("transactionId", DefaultValueHandling = DefaultValueHandling.Include)]
[Display(Name="Identifier")]
public string? Id
{
get => _id;
- set => SetValue(ref _id, value, false, StringTrim.UseDefault, StringTransform.UseDefault, nameof(Id));
+ set => SetValue(ref _id, value, false, StringTrim.UseDefault, StringTransform.UseDefault, nameof(Id));
}
///
@@ -66,18 +66,18 @@ public string? Id
public string? AccountId
{
get => _accountId;
- set => SetValue(ref _accountId, value, false, StringTrim.UseDefault, StringTransform.UseDefault, nameof(AccountId));
+ set => SetValue(ref _accountId, value, false, StringTrim.UseDefault, StringTransform.UseDefault, nameof(AccountId));
}
///
- /// Gets or sets a value indicating whether Is Detail Available.
+ /// Indicates whether Is Detail Available.
///
[JsonProperty("isDetailAvailable", DefaultValueHandling = DefaultValueHandling.Ignore)]
[Display(Name="Is Detail Available")]
public bool IsDetailAvailable
{
get => _isDetailAvailable;
- set => SetValue(ref _isDetailAvailable, value, false, false, nameof(IsDetailAvailable));
+ set => SetValue(ref _isDetailAvailable, value, false, false, nameof(IsDetailAvailable));
}
///
@@ -132,7 +132,7 @@ public RefDataNamespace.TransactionStatus? Status
public string? Description
{
get => _description;
- set => SetValue(ref _description, value, false, StringTrim.UseDefault, StringTransform.UseDefault, nameof(Description));
+ set => SetValue(ref _description, value, false, StringTrim.UseDefault, StringTransform.UseDefault, nameof(Description));
}
///
@@ -140,11 +140,10 @@ public string? Description
///
[JsonProperty("postingDateTime", DefaultValueHandling = DefaultValueHandling.Ignore)]
[Display(Name="Posting Date Time")]
- [DisplayFormat(DataFormatString = Beef.Entities.StringFormat.DateTimeFormat)]
public DateTime PostingDateTime
{
get => _postingDateTime;
- set => SetValue(ref _postingDateTime, value, false, DateTimeTransform.UseDefault, nameof(PostingDateTime));
+ set => SetValue(ref _postingDateTime, value, false, DateTimeTransform.UseDefault, nameof(PostingDateTime));
}
///
@@ -152,11 +151,10 @@ public DateTime PostingDateTime
///
[JsonProperty("executionDateTime", DefaultValueHandling = DefaultValueHandling.Ignore)]
[Display(Name="Execution Date Time")]
- [DisplayFormat(DataFormatString = Beef.Entities.StringFormat.DateTimeFormat)]
public DateTime ExecutionDateTime
{
get => _executionDateTime;
- set => SetValue(ref _executionDateTime, value, false, DateTimeTransform.UseDefault, nameof(ExecutionDateTime));
+ set => SetValue(ref _executionDateTime, value, false, DateTimeTransform.UseDefault, nameof(ExecutionDateTime));
}
///
@@ -167,7 +165,7 @@ public DateTime ExecutionDateTime
public decimal Amount
{
get => _amount;
- set => SetValue(ref _amount, value, false, false, nameof(Amount));
+ set => SetValue(ref _amount, value, false, false, nameof(Amount));
}
///
@@ -178,7 +176,7 @@ public decimal Amount
public string? Currency
{
get => _currency;
- set => SetValue(ref _currency, value, false, StringTrim.UseDefault, StringTransform.UseDefault, nameof(Currency));
+ set => SetValue(ref _currency, value, false, StringTrim.UseDefault, StringTransform.UseDefault, nameof(Currency));
}
///
@@ -189,7 +187,7 @@ public string? Currency
public string? Reference
{
get => _reference;
- set => SetValue(ref _reference, value, false, StringTrim.UseDefault, StringTransform.UseDefault, nameof(Reference));
+ set => SetValue(ref _reference, value, false, StringTrim.UseDefault, StringTransform.UseDefault, nameof(Reference));
}
///
@@ -200,7 +198,7 @@ public string? Reference
public string? MerchantName
{
get => _merchantName;
- set => SetValue(ref _merchantName, value, false, StringTrim.UseDefault, StringTransform.UseDefault, nameof(MerchantName));
+ set => SetValue(ref _merchantName, value, false, StringTrim.UseDefault, StringTransform.UseDefault, nameof(MerchantName));
}
///
@@ -211,7 +209,7 @@ public string? MerchantName
public string? MerchantCategoryCode
{
get => _merchantCategoryCode;
- set => SetValue(ref _merchantCategoryCode, value, false, StringTrim.UseDefault, StringTransform.UseDefault, nameof(MerchantCategoryCode));
+ set => SetValue(ref _merchantCategoryCode, value, false, StringTrim.UseDefault, StringTransform.UseDefault, nameof(MerchantCategoryCode));
}
///
@@ -222,7 +220,7 @@ public string? MerchantCategoryCode
public string? BillerCode
{
get => _billerCode;
- set => SetValue(ref _billerCode, value, false, StringTrim.UseDefault, StringTransform.UseDefault, nameof(BillerCode));
+ set => SetValue(ref _billerCode, value, false, StringTrim.UseDefault, StringTransform.UseDefault, nameof(BillerCode));
}
///
@@ -233,7 +231,7 @@ public string? BillerCode
public string? BillerName
{
get => _billerName;
- set => SetValue(ref _billerName, value, false, StringTrim.UseDefault, StringTransform.UseDefault, nameof(BillerName));
+ set => SetValue(ref _billerName, value, false, StringTrim.UseDefault, StringTransform.UseDefault, nameof(BillerName));
}
///
@@ -244,13 +242,13 @@ public string? BillerName
public string? ApcaNumber
{
get => _apcaNumber;
- set => SetValue(ref _apcaNumber, value, false, StringTrim.UseDefault, StringTransform.UseDefault, nameof(ApcaNumber));
+ set => SetValue(ref _apcaNumber, value, false, StringTrim.UseDefault, StringTransform.UseDefault, nameof(ApcaNumber));
}
#endregion
- #region UniqueKey
-
+ #region IUniqueKey
+
///
/// Indicates whether the has a value.
///
@@ -260,20 +258,17 @@ public string? ApcaNumber
/// Gets the list of property names that represent the unique key.
///
public override string[] UniqueKeyProperties => new string[] { nameof(Id) };
-
+
///
/// Creates the .
///
/// The .
/// The .
- public static UniqueKey CreateUniqueKey(string id) => new UniqueKey(id);
-
+ public static UniqueKey CreateUniqueKey(string? id) => new UniqueKey(id);
+
///
- /// Gets the .
+ /// Gets the (consists of the following property(s): ).
///
- ///
- /// The UniqueKey key consists of the following property(s): .
- ///
public override UniqueKey UniqueKey => new UniqueKey(Id);
#endregion
@@ -285,43 +280,37 @@ public string? ApcaNumber
///
/// The object to compare with the current object.
/// true if the specified object is equal to the current object; otherwise, false.
- public override bool Equals(object? obj)
- {
- if (!(obj is Transaction val))
- return false;
-
- return Equals(val);
- }
+ public override bool Equals(object? obj) => obj is Transaction val && Equals(val);
///
/// Determines whether the specified is equal to the current by comparing the values of all the properties.
///
- /// The object to compare with the current object.
- /// true if the specified object is equal to the current object; otherwise, false.
- public bool Equals(Transaction? obj)
+ /// The to compare with the current .
+ /// true if the specified is equal to the current ; otherwise, false.
+ public bool Equals(Transaction? value)
{
- if (obj == null)
+ if (value == null)
return false;
- else if (ReferenceEquals(obj, this))
+ else if (ReferenceEquals(value, this))
return true;
- return base.Equals((object)obj)
- && Equals(Id, obj.Id)
- && Equals(AccountId, obj.AccountId)
- && Equals(IsDetailAvailable, obj.IsDetailAvailable)
- && Equals(TypeSid, obj.TypeSid)
- && Equals(StatusSid, obj.StatusSid)
- && Equals(Description, obj.Description)
- && Equals(PostingDateTime, obj.PostingDateTime)
- && Equals(ExecutionDateTime, obj.ExecutionDateTime)
- && Equals(Amount, obj.Amount)
- && Equals(Currency, obj.Currency)
- && Equals(Reference, obj.Reference)
- && Equals(MerchantName, obj.MerchantName)
- && Equals(MerchantCategoryCode, obj.MerchantCategoryCode)
- && Equals(BillerCode, obj.BillerCode)
- && Equals(BillerName, obj.BillerName)
- && Equals(ApcaNumber, obj.ApcaNumber);
+ return base.Equals((object)value)
+ && Equals(Id, value.Id)
+ && Equals(AccountId, value.AccountId)
+ && Equals(IsDetailAvailable, value.IsDetailAvailable)
+ && Equals(TypeSid, value.TypeSid)
+ && Equals(StatusSid, value.StatusSid)
+ && Equals(Description, value.Description)
+ && Equals(PostingDateTime, value.PostingDateTime)
+ && Equals(ExecutionDateTime, value.ExecutionDateTime)
+ && Equals(Amount, value.Amount)
+ && Equals(Currency, value.Currency)
+ && Equals(Reference, value.Reference)
+ && Equals(MerchantName, value.MerchantName)
+ && Equals(MerchantCategoryCode, value.MerchantCategoryCode)
+ && Equals(BillerCode, value.BillerCode)
+ && Equals(BillerName, value.BillerName)
+ && Equals(ApcaNumber, value.ApcaNumber);
}
///
@@ -341,9 +330,9 @@ public bool Equals(Transaction? obj)
public static bool operator != (Transaction? a, Transaction? b) => !Equals(a, b);
///
- /// Returns a hash code for the .
+ /// Returns the hash code for the .
///
- /// A hash code for the .
+ /// The hash code for the .
public override int GetHashCode()
{
var hash = new HashCode();
@@ -367,7 +356,7 @@ public override int GetHashCode()
}
#endregion
-
+
#region ICopyFrom
///
@@ -386,8 +375,8 @@ public override void CopyFrom(object from)
/// The to copy from.
public void CopyFrom(Transaction from)
{
- if (from == null)
- throw new ArgumentNullException(nameof(from));
+ if (from == null)
+ throw new ArgumentNullException(nameof(from));
CopyFrom((EntityBase)from);
Id = from.Id;
@@ -409,9 +398,9 @@ public void CopyFrom(Transaction from)
OnAfterCopyFrom(from);
}
-
+
#endregion
-
+
#region ICloneable
///
@@ -454,7 +443,7 @@ public override void CleanUp()
OnAfterCleanUp();
}
-
+
///
/// Indicates whether considered initial; i.e. all properties have their initial value.
///
@@ -491,31 +480,27 @@ public override bool IsInitial
partial void OnAfterCopyFrom(Transaction from);
#endregion
- }
+ }
+
+ #region Collection
///
- /// Represents a collection.
+ /// Represents the collection.
///
[SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1402:FileMayOnlyContainASingleClass", Justification = "Tightly coupled; OK.")]
public partial class TransactionCollection : EntityBaseCollection
{
- #region Constructors
-
///
/// Initializes a new instance of the class.
///
- public TransactionCollection(){ }
+ public TransactionCollection() { }
///
- /// Initializes a new instance of the class with an entity range.
+ /// Initializes a new instance of the class with an entities range.
///
/// The entities.
public TransactionCollection(IEnumerable entities) => AddRange(entities);
- #endregion
-
- #region ICloneable
-
///
/// Creates a deep copy of the .
///
@@ -523,31 +508,29 @@ public TransactionCollection(){ }
public override object Clone()
{
var clone = new TransactionCollection();
- foreach (Transaction item in this)
+ foreach (var item in this)
{
clone.Add((Transaction)item.Clone());
}
return clone;
}
-
- #endregion
-
- #region Operator
///
- /// An implicit cast from a to a .
+ /// An implicit cast from the to a corresponding .
///
/// The .
/// The corresponding .
[SuppressMessage("Usage", "CA2225:Operator overloads have named alternates", Justification = "Improves useability")]
public static implicit operator TransactionCollection(TransactionCollectionResult result) => result?.Result!;
-
- #endregion
}
+ #endregion
+
+ #region CollectionResult
+
///
- /// Represents a collection result.
+ /// Represents the collection result.
///
[SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1402:FileMayOnlyContainASingleClass", Justification = "Tightly coupled; OK.")]
public class TransactionCollectionResult : EntityCollectionResult
@@ -558,7 +541,7 @@ public class TransactionCollectionResult : EntityCollectionResult
- /// Initializes a new instance of the class with default .
+ /// Initializes a new instance of the class with .
///
/// The .
public TransactionCollectionResult(PagingArgs? paging) : base(paging) { }
@@ -581,6 +564,8 @@ public override object Clone()
return clone;
}
}
+
+ #endregion
}
#pragma warning restore CA2227, CA1819
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 fd732f6b9..8f3183e60 100644
--- a/samples/Cdr.Banking/Cdr.Banking.Common/Entities/Generated/TransactionArgs.cs
+++ b/samples/Cdr.Banking/Cdr.Banking.Common/Entities/Generated/TransactionArgs.cs
@@ -41,11 +41,10 @@ public partial class TransactionArgs : EntityBase, IEquatable
///
[JsonProperty("oldest-time", DefaultValueHandling = DefaultValueHandling.Ignore)]
[Display(Name="Oldest time")]
- [DisplayFormat(DataFormatString = Beef.Entities.StringFormat.DateTimeFormat)]
public DateTime? FromDate
{
get => _fromDate;
- set => SetValue(ref _fromDate, value, false, DateTimeTransform.UseDefault, nameof(FromDate));
+ set => SetValue(ref _fromDate, value, false, DateTimeTransform.UseDefault, nameof(FromDate));
}
///
@@ -53,11 +52,10 @@ public DateTime? FromDate
///
[JsonProperty("newest-time", DefaultValueHandling = DefaultValueHandling.Ignore)]
[Display(Name="Newest time")]
- [DisplayFormat(DataFormatString = Beef.Entities.StringFormat.DateTimeFormat)]
public DateTime? ToDate
{
get => _toDate;
- set => SetValue(ref _toDate, value, false, DateTimeTransform.UseDefault, nameof(ToDate));
+ set => SetValue(ref _toDate, value, false, DateTimeTransform.UseDefault, nameof(ToDate));
}
///
@@ -68,7 +66,7 @@ public DateTime? ToDate
public decimal? MinAmount
{
get => _minAmount;
- set => SetValue(ref _minAmount, value, false, false, nameof(MinAmount));
+ set => SetValue(ref _minAmount, value, false, false, nameof(MinAmount));
}
///
@@ -79,7 +77,7 @@ public decimal? MinAmount
public decimal? MaxAmount
{
get => _maxAmount;
- set => SetValue(ref _maxAmount, value, false, false, nameof(MaxAmount));
+ set => SetValue(ref _maxAmount, value, false, false, nameof(MaxAmount));
}
///
@@ -90,7 +88,7 @@ public decimal? MaxAmount
public string? Text
{
get => _text;
- set => SetValue(ref _text, value, false, StringTrim.UseDefault, StringTransform.UseDefault, nameof(Text));
+ set => SetValue(ref _text, value, false, StringTrim.UseDefault, StringTransform.UseDefault, nameof(Text));
}
#endregion
@@ -102,32 +100,26 @@ public string? Text
///
/// The object to compare with the current object.
/// true if the specified object is equal to the current object; otherwise, false.
- public override bool Equals(object? obj)
- {
- if (!(obj is TransactionArgs val))
- return false;
-
- return Equals(val);
- }
+ public override bool Equals(object? obj) => obj is TransactionArgs val && Equals(val);
///
/// Determines whether the specified is equal to the current by comparing the values of all the properties.
///
- /// The object to compare with the current object.
- /// true if the specified object is equal to the current object; otherwise, false.
- public bool Equals(TransactionArgs? obj)
+ /// The to compare with the current .
+ /// true if the specified is equal to the current ; otherwise, false.
+ public bool Equals(TransactionArgs? value)
{
- if (obj == null)
+ if (value == null)
return false;
- else if (ReferenceEquals(obj, this))
+ else if (ReferenceEquals(value, this))
return true;
- return base.Equals((object)obj)
- && Equals(FromDate, obj.FromDate)
- && Equals(ToDate, obj.ToDate)
- && Equals(MinAmount, obj.MinAmount)
- && Equals(MaxAmount, obj.MaxAmount)
- && Equals(Text, obj.Text);
+ return base.Equals((object)value)
+ && Equals(FromDate, value.FromDate)
+ && Equals(ToDate, value.ToDate)
+ && Equals(MinAmount, value.MinAmount)
+ && Equals(MaxAmount, value.MaxAmount)
+ && Equals(Text, value.Text);
}
///
@@ -147,9 +139,9 @@ public bool Equals(TransactionArgs? obj)
public static bool operator != (TransactionArgs? a, TransactionArgs? b) => !Equals(a, b);
///
- /// Returns a hash code for the .
+ /// Returns the hash code for the .
///
- /// A hash code for the .
+ /// The hash code for the .
public override int GetHashCode()
{
var hash = new HashCode();
@@ -162,7 +154,7 @@ public override int GetHashCode()
}
#endregion
-
+
#region ICopyFrom
///
@@ -181,8 +173,8 @@ public override void CopyFrom(object from)
/// The to copy from.
public void CopyFrom(TransactionArgs from)
{
- if (from == null)
- throw new ArgumentNullException(nameof(from));
+ if (from == null)
+ throw new ArgumentNullException(nameof(from));
CopyFrom((EntityBase)from);
FromDate = from.FromDate;
@@ -193,9 +185,9 @@ public void CopyFrom(TransactionArgs from)
OnAfterCopyFrom(from);
}
-
+
#endregion
-
+
#region ICloneable
///
@@ -227,7 +219,7 @@ public override void CleanUp()
OnAfterCleanUp();
}
-
+
///
/// Indicates whether considered initial; i.e. all properties have their initial value.
///
@@ -253,7 +245,7 @@ public override bool IsInitial
partial void OnAfterCopyFrom(TransactionArgs from);
#endregion
- }
+ }
}
#pragma warning restore CA2227, CA1819
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 cf1419fab..12622c57a 100644
--- a/samples/Cdr.Banking/Cdr.Banking.Common/Entities/Generated/TransactionStatus.cs
+++ b/samples/Cdr.Banking/Cdr.Banking.Common/Entities/Generated/TransactionStatus.cs
@@ -33,10 +33,7 @@ public partial class TransactionStatus : ReferenceDataBaseGuid
/// The Id.
/// The corresponding .
[SuppressMessage("Usage", "CA2225:Operator overloads have named alternates", Justification = "Improves useability")]
- public static implicit operator TransactionStatus(Guid id)
- {
- return ConvertFromId(id);
- }
+ public static implicit operator TransactionStatus(Guid id) => ConvertFromId(id);
///
/// An implicit cast from a Code to a .
@@ -44,13 +41,10 @@ public static implicit operator TransactionStatus(Guid id)
/// The Code.
/// The corresponding .
[SuppressMessage("Usage", "CA2225:Operator overloads have named alternates", Justification = "Improves useability")]
- public static implicit operator TransactionStatus(string? code)
- {
- return ConvertFromCode(code);
- }
+ public static implicit operator TransactionStatus(string? code) => ConvertFromCode(code);
#endregion
-
+
#region ICopyFrom
///
@@ -69,16 +63,16 @@ public override void CopyFrom(object from)
/// The to copy from.
public void CopyFrom(TransactionStatus from)
{
- if (from == null)
- throw new ArgumentNullException(nameof(from));
+ if (from == null)
+ throw new ArgumentNullException(nameof(from));
CopyFrom((ReferenceDataBaseGuid)from);
OnAfterCopyFrom(from);
}
-
+
#endregion
-
+
#region ICloneable
///
@@ -105,7 +99,7 @@ public override void CleanUp()
OnAfterCleanUp();
}
-
+
///
/// Indicates whether considered initial; i.e. all properties have their initial value.
///
@@ -130,29 +124,29 @@ public override bool IsInitial
partial void OnAfterCopyFrom(TransactionStatus from);
#endregion
- }
+ }
+
+ #region Collection
///
- /// Represents a collection.
+ /// Represents the collection.
///
[SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1402:FileMayOnlyContainASingleClass", Justification = "Tightly coupled; OK.")]
public partial class TransactionStatusCollection : ReferenceDataCollectionBase
{
- #region Constructors
-
///
/// Initializes a new instance of the class.
///
- public TransactionStatusCollection(){ }
+ public TransactionStatusCollection() { }
///
- /// Initializes a new instance of the class with an entity range.
+ /// Initializes a new instance of the class with an entities range.
///
/// The entities.
public TransactionStatusCollection(IEnumerable entities) => AddRange(entities);
-
- #endregion
}
+
+ #endregion
}
#pragma warning restore CA2227, CA1819
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 3579f009f..be54a60fd 100644
--- a/samples/Cdr.Banking/Cdr.Banking.Common/Entities/Generated/TransactionType.cs
+++ b/samples/Cdr.Banking/Cdr.Banking.Common/Entities/Generated/TransactionType.cs
@@ -33,10 +33,7 @@ public partial class TransactionType : ReferenceDataBaseGuid
/// The Id.
/// The corresponding .
[SuppressMessage("Usage", "CA2225:Operator overloads have named alternates", Justification = "Improves useability")]
- public static implicit operator TransactionType(Guid id)
- {
- return ConvertFromId(id);
- }
+ public static implicit operator TransactionType(Guid id) => ConvertFromId(id);
///
/// An implicit cast from a Code to a .
@@ -44,13 +41,10 @@ public static implicit operator TransactionType(Guid id)
/// The Code.
/// The corresponding .
[SuppressMessage("Usage", "CA2225:Operator overloads have named alternates", Justification = "Improves useability")]
- public static implicit operator TransactionType(string? code)
- {
- return ConvertFromCode(code);
- }
+ public static implicit operator TransactionType(string? code) => ConvertFromCode(code);
#endregion
-
+
#region ICopyFrom
///
@@ -69,16 +63,16 @@ public override void CopyFrom(object from)
/// The to copy from.
public void CopyFrom(TransactionType from)
{
- if (from == null)
- throw new ArgumentNullException(nameof(from));
+ if (from == null)
+ throw new ArgumentNullException(nameof(from));
CopyFrom((ReferenceDataBaseGuid)from);
OnAfterCopyFrom(from);
}
-
+
#endregion
-
+
#region ICloneable
///
@@ -105,7 +99,7 @@ public override void CleanUp()
OnAfterCleanUp();
}
-
+
///
/// Indicates whether considered initial; i.e. all properties have their initial value.
///
@@ -130,29 +124,29 @@ public override bool IsInitial
partial void OnAfterCopyFrom(TransactionType from);
#endregion
- }
+ }
+
+ #region Collection
///
- /// Represents a collection.
+ /// Represents the collection.
///
[SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1402:FileMayOnlyContainASingleClass", Justification = "Tightly coupled; OK.")]
public partial class TransactionTypeCollection : ReferenceDataCollectionBase
{
- #region Constructors
-
///
/// Initializes a new instance of the class.
///
- public TransactionTypeCollection(){ }
+ public TransactionTypeCollection() { }
///
- /// Initializes a new instance of the class with an entity range.
+ /// Initializes a new instance of the class with an entities range.
///
/// The entities.
public TransactionTypeCollection(IEnumerable entities) => AddRange(entities);
-
- #endregion
}
+
+ #endregion
}
#pragma warning restore CA2227, CA1819
diff --git a/samples/Demo/Beef.Demo.Api/Controllers/Generated/ConfigController.cs b/samples/Demo/Beef.Demo.Api/Controllers/Generated/ConfigController.cs
index 4e724e82e..ed336a9b2 100644
--- a/samples/Demo/Beef.Demo.Api/Controllers/Generated/ConfigController.cs
+++ b/samples/Demo/Beef.Demo.Api/Controllers/Generated/ConfigController.cs
@@ -23,22 +23,27 @@ namespace Beef.Demo.Api.Controllers
///
/// Provides the Config Web API functionality.
///
+ [AllowAnonymous]
[Route("api/v1/envvars")]
public partial class ConfigController : ControllerBase
{
private readonly IConfigManager _manager;
-
+
///
/// Initializes a new instance of the class.
///
/// The .
- public ConfigController(IConfigManager manager) => _manager = Check.NotNull(manager, nameof(manager));
+ public ConfigController(IConfigManager manager)
+ { _manager = Check.NotNull(manager, nameof(manager)); ConfigControllerCtor(); }
+
+ partial void ConfigControllerCtor(); // Enables additional functionality to be added to the constructor.
///
/// Get Env Vars.
///
/// A resultant .
- [HttpPost]
+ [AllowAnonymous]
+ [HttpPost("")]
[ProducesResponseType(typeof(System.Collections.IDictionary), (int)HttpStatusCode.OK)]
[ProducesResponseType((int)HttpStatusCode.NoContent)]
public IActionResult GetEnvVars()
diff --git a/samples/Demo/Beef.Demo.Api/Controllers/Generated/ContactController.cs b/samples/Demo/Beef.Demo.Api/Controllers/Generated/ContactController.cs
index 6d1d6d784..564bfe327 100644
--- a/samples/Demo/Beef.Demo.Api/Controllers/Generated/ContactController.cs
+++ b/samples/Demo/Beef.Demo.Api/Controllers/Generated/ContactController.cs
@@ -21,25 +21,29 @@
namespace Beef.Demo.Api.Controllers
{
///
- /// Provides the Contact Web API functionality.
+ /// Provides the Web API functionality.
///
+ [AllowAnonymous]
[Route("api/v1/contacts")]
public partial class ContactController : ControllerBase
{
private readonly IContactManager _manager;
-
+
///
/// Initializes a new instance of the class.
///
/// The .
- public ContactController(IContactManager manager) => _manager = Check.NotNull(manager, nameof(manager));
+ public ContactController(IContactManager manager)
+ { _manager = Check.NotNull(manager, nameof(manager)); ContactControllerCtor(); }
+
+ partial void ContactControllerCtor(); // Enables additional functionality to be added to the constructor.
///
- /// Gets the collection entity that matches the selection criteria.
+ /// Gets the that contains the items that match the selection criteria.
///
- /// A .
- [HttpGet()]
- [Route("")]
+ /// The
+ [AllowAnonymous]
+ [HttpGet("")]
[ProducesResponseType(typeof(ContactCollection), (int)HttpStatusCode.OK)]
[ProducesResponseType((int)HttpStatusCode.NoContent)]
public IActionResult GetAll()
@@ -49,12 +53,12 @@ public IActionResult GetAll()
}
///
- /// Gets the entity that matches the selection criteria.
+ /// Gets the specified .
///
/// The identifier.
- /// The selected entity where found.
- [HttpGet()]
- [Route("{id}")]
+ /// The selected where found.
+ [AllowAnonymous]
+ [HttpGet("{id}")]
[ProducesResponseType(typeof(Contact), (int)HttpStatusCode.OK)]
[ProducesResponseType((int)HttpStatusCode.NotFound)]
public IActionResult Get(Guid id)
@@ -64,12 +68,12 @@ public IActionResult Get(Guid id)
}
///
- /// Creates the entity.
+ /// Creates a new .
///
- /// The entity.
- /// The created entity.
- [HttpPost()]
- [Route("")]
+ /// The .
+ /// The created .
+ [AllowAnonymous]
+ [HttpPost("")]
[ProducesResponseType(typeof(Contact), (int)HttpStatusCode.Created)]
public IActionResult Create([FromBody] Contact value)
{
@@ -78,13 +82,13 @@ public IActionResult Create([FromBody] Contact value)
}
///
- /// Updates the entity.
+ /// Updates an existing .
///
- /// The entity.
+ /// The .
/// The identifier.
- /// The updated entity.
- [HttpPut()]
- [Route("{id}")]
+ /// The updated .
+ [AllowAnonymous]
+ [HttpPut("{id}")]
[ProducesResponseType(typeof(Contact), (int)HttpStatusCode.OK)]
public IActionResult Update([FromBody] Contact value, Guid id)
{
@@ -93,11 +97,11 @@ public IActionResult Update([FromBody] Contact value, Guid id)
}
///
- /// Deletes the entity that matches the selection criteria.
+ /// Deletes the specified .
///
/// The identifier.
- [HttpDelete()]
- [Route("{id}")]
+ [AllowAnonymous]
+ [HttpDelete("{id}")]
[ProducesResponseType((int)HttpStatusCode.NoContent)]
public IActionResult Delete(Guid id)
{
diff --git a/samples/Demo/Beef.Demo.Api/Controllers/Generated/GenderController.cs b/samples/Demo/Beef.Demo.Api/Controllers/Generated/GenderController.cs
index 547e2ff25..5c6450d34 100644
--- a/samples/Demo/Beef.Demo.Api/Controllers/Generated/GenderController.cs
+++ b/samples/Demo/Beef.Demo.Api/Controllers/Generated/GenderController.cs
@@ -21,26 +21,30 @@
namespace Beef.Demo.Api.Controllers
{
///
- /// Provides the Gender Web API functionality.
+ /// Provides the Web API functionality.
///
+ [AllowAnonymous]
[Route("api/v1/demo/ref/genders")]
public partial class GenderController : ControllerBase
{
private readonly IGenderManager _manager;
-
+
///
/// Initializes a new instance of the class.
///
/// The .
- public GenderController(IGenderManager manager) => _manager = Check.NotNull(manager, nameof(manager));
+ public GenderController(IGenderManager manager)
+ { _manager = Check.NotNull(manager, nameof(manager)); GenderControllerCtor(); }
+
+ partial void GenderControllerCtor(); // Enables additional functionality to be added to the constructor.
///
- /// Gets the entity that matches the selection criteria.
+ /// Gets the specified .
///
/// The identifier.
- /// The selected entity where found.
- [HttpGet()]
- [Route("{id}")]
+ /// The selected where found.
+ [AllowAnonymous]
+ [HttpGet("{id}")]
[ProducesResponseType(typeof(Gender), (int)HttpStatusCode.OK)]
[ProducesResponseType((int)HttpStatusCode.NotFound)]
public IActionResult Get(Guid id)
@@ -50,12 +54,12 @@ public IActionResult Get(Guid id)
}
///
- /// Creates the entity.
+ /// Creates a new .
///
- /// The entity.
- /// The created entity.
- [HttpPost()]
- [Route("")]
+ /// The .
+ /// The created .
+ [AllowAnonymous]
+ [HttpPost("")]
[ProducesResponseType(typeof(Gender), (int)HttpStatusCode.Created)]
public IActionResult Create([FromBody] Gender value)
{
@@ -64,13 +68,13 @@ public IActionResult Create([FromBody] Gender value)
}
///
- /// Updates the entity.
+ /// Updates an existing .
///
- /// The entity.
+ /// The .
/// The identifier.
- /// The updated entity.
- [HttpPut()]
- [Route("{id}")]
+ /// The updated .
+ [AllowAnonymous]
+ [HttpPut("{id}")]
[ProducesResponseType(typeof(Gender), (int)HttpStatusCode.OK)]
public IActionResult Update([FromBody] Gender value, Guid id)
{
diff --git a/samples/Demo/Beef.Demo.Api/Controllers/Generated/PersonController.cs b/samples/Demo/Beef.Demo.Api/Controllers/Generated/PersonController.cs
index 320048175..f8b15f628 100644
--- a/samples/Demo/Beef.Demo.Api/Controllers/Generated/PersonController.cs
+++ b/samples/Demo/Beef.Demo.Api/Controllers/Generated/PersonController.cs
@@ -21,26 +21,32 @@
namespace Beef.Demo.Api.Controllers
{
///
- /// Provides the Person Web API functionality.
+ /// Provides the Web API functionality.
///
+ [AllowAnonymous]
[Route("api/v1/persons")]
public partial class PersonController : ControllerBase
{
private readonly IPersonManager _manager;
-
+ private readonly IPersonManager _personManager;
+
///
/// Initializes a new instance of the class.
///
/// The .
- public PersonController(IPersonManager manager) => _manager = Check.NotNull(manager, nameof(manager));
+ /// The .
+ public PersonController(IPersonManager manager, IPersonManager personManager)
+ { _manager = Check.NotNull(manager, nameof(manager)); _personManager = Check.NotNull(personManager, nameof(personManager)); PersonControllerCtor(); }
+
+ partial void PersonControllerCtor(); // Enables additional functionality to be added to the constructor.
///
- /// Creates the entity.
+ /// Creates a new .
///
- /// The entity.
- /// The created entity.
- [HttpPost()]
- [Route("")]
+ /// The .
+ /// The created .
+ [AllowAnonymous]
+ [HttpPost("")]
[ProducesResponseType(typeof(Person), (int)HttpStatusCode.Created)]
public IActionResult Create([FromBody] Person value)
{
@@ -49,11 +55,11 @@ public IActionResult Create([FromBody] Person value)
}
///
- /// Deletes the entity that matches the selection criteria.
+ /// Deletes the specified .
///
/// The identifier.
- [HttpDelete()]
- [Route("{id}")]
+ [AllowAnonymous]
+ [HttpDelete("{id}")]
[ProducesResponseType((int)HttpStatusCode.NoContent)]
public IActionResult Delete(Guid id)
{
@@ -62,12 +68,12 @@ public IActionResult Delete(Guid id)
}
///
- /// Gets the entity that matches the selection criteria.
+ /// Gets the specified .
///
/// The identifier.
- /// The selected entity where found.
- [HttpGet()]
- [Route("{id}")]
+ /// The selected where found.
+ [AllowAnonymous]
+ [HttpGet("{id}")]
[ProducesResponseType(typeof(Person), (int)HttpStatusCode.OK)]
[ProducesResponseType((int)HttpStatusCode.NotFound)]
public IActionResult Get(Guid id)
@@ -77,13 +83,13 @@ public IActionResult Get(Guid id)
}
///
- /// Updates the entity.
+ /// Updates an existing .
///
- /// The entity.
+ /// The .
/// The identifier.
- /// The updated entity.
- [HttpPut()]
- [Route("{id}")]
+ /// The updated .
+ [AllowAnonymous]
+ [HttpPut("{id}")]
[ProducesResponseType(typeof(Person), (int)HttpStatusCode.OK)]
public IActionResult Update([FromBody] Person value, Guid id)
{
@@ -92,13 +98,13 @@ public IActionResult Update([FromBody] Person value, Guid id)
}
///
- /// Patches the entity.
+ /// Patches an existing .
///
- /// The value that contains the patch content for the entity.
+ /// The that contains the patch content for the .
/// The identifier.
- /// The patched entity.
- [HttpPatch()]
- [Route("{id}")]
+ /// The patched .
+ [AllowAnonymous]
+ [HttpPatch("{id}")]
[ProducesResponseType(typeof(Person), (int)HttpStatusCode.OK)]
public IActionResult Patch([FromBody] JToken value, Guid id)
{
@@ -107,11 +113,11 @@ public IActionResult Patch([FromBody] JToken value, Guid id)
}
///
- /// Gets the collection entity that matches the selection criteria.
+ /// Gets the that contains the items that match the selection criteria.
///
- /// A .
- [HttpGet()]
- [Route("all")]
+ /// The
+ [AllowAnonymous]
+ [HttpGet("all")]
[ProducesResponseType(typeof(PersonCollection), (int)HttpStatusCode.OK)]
[ProducesResponseType((int)HttpStatusCode.NoContent)]
public IActionResult GetAll()
@@ -121,11 +127,11 @@ public IActionResult GetAll()
}
///
- /// Gets the collection entity that matches the selection criteria.
+ /// Gets the that contains the items that match the selection criteria.
///
- /// A .
- [HttpGet()]
- [Route("allnopaging")]
+ /// The
+ [AllowAnonymous]
+ [HttpGet("allnopaging")]
[ProducesResponseType(typeof(PersonCollection), (int)HttpStatusCode.OK)]
[ProducesResponseType((int)HttpStatusCode.NoContent)]
public IActionResult GetAll2()
@@ -135,14 +141,14 @@ public IActionResult GetAll2()
}
///
- /// Gets the collection entity that matches the selection criteria.
+ /// Gets the that contains the items that match the selection criteria.
///
/// The First Name.
/// The Last Name.
- /// The Genders (see ).
- /// A .
- [HttpGet()]
- [Route("")]
+ /// The Genders (see ).
+ /// The
+ [AllowAnonymous]
+ [HttpGet("")]
[ProducesResponseType(typeof(PersonCollection), (int)HttpStatusCode.OK)]
[ProducesResponseType((int)HttpStatusCode.NoContent)]
public IActionResult GetByArgs(string? firstName = default, string? lastName = default, List? genders = default)
@@ -153,14 +159,14 @@ public IActionResult GetByArgs(string? firstName = default, string? lastName = d
}
///
- /// Gets the collection entity that matches the selection criteria.
+ /// Gets the that contains the items that match the selection criteria.
///
/// The First Name.
/// The Last Name.
- /// The Genders (see ).
- /// A .
- [HttpGet()]
- [Route("argsdetail")]
+ /// The Genders (see ).
+ /// The
+ [AllowAnonymous]
+ [HttpGet("argsdetail")]
[ProducesResponseType(typeof(PersonDetailCollection), (int)HttpStatusCode.OK)]
[ProducesResponseType((int)HttpStatusCode.NoContent)]
public IActionResult GetDetailByArgs(string? firstName = default, string? lastName = default, List? genders = default)
@@ -176,8 +182,8 @@ public IActionResult GetDetailByArgs(string? firstName = default, string? lastNa
/// The from identifier.
/// The to identifier.
/// A resultant .
- [HttpPost]
- [Route("merge")]
+ [AllowAnonymous]
+ [HttpPost("merge")]
[ProducesResponseType(typeof(Person), (int)HttpStatusCode.OK)]
public IActionResult Merge(Guid fromId, Guid toId)
{
@@ -188,8 +194,8 @@ public IActionResult Merge(Guid fromId, Guid toId)
///
/// Mark .
///
- [HttpPost]
- [Route("mark")]
+ [AllowAnonymous]
+ [HttpPost("mark")]
[ProducesResponseType((int)HttpStatusCode.Accepted)]
public IActionResult Mark()
{
@@ -200,10 +206,10 @@ public IActionResult Mark()
///
/// Get at specified .
///
- /// The Coordinates (see ).
+ /// The Coordinates (see ).
/// A resultant .
- [HttpPost]
- [Route("map")]
+ [AllowAnonymous]
+ [HttpPost("map")]
[ProducesResponseType(typeof(MapCoordinates), (int)HttpStatusCode.OK)]
[ProducesResponseType((int)HttpStatusCode.NoContent)]
public IActionResult Map(string? coordinates = default)
@@ -216,9 +222,9 @@ public IActionResult Map(string? coordinates = default)
///
/// Get no arguments.
///
- /// The selected entity where found.
- [HttpGet()]
- [Route("noargsforme")]
+ /// The selected where found.
+ [AllowAnonymous]
+ [HttpGet("noargsforme")]
[ProducesResponseType(typeof(Person), (int)HttpStatusCode.OK)]
[ProducesResponseType((int)HttpStatusCode.NotFound)]
public IActionResult GetNoArgs()
@@ -228,12 +234,12 @@ public IActionResult GetNoArgs()
}
///
- /// Gets the entity that matches the selection criteria.
+ /// Gets the specified .
///
/// The identifier.
- /// The selected entity where found.
- [HttpGet()]
- [Route("{id}/detail")]
+ /// The selected where found.
+ [AllowAnonymous]
+ [HttpGet("{id}/detail")]
[ProducesResponseType(typeof(PersonDetail), (int)HttpStatusCode.OK)]
[ProducesResponseType((int)HttpStatusCode.NotFound)]
public IActionResult GetDetail(Guid id)
@@ -243,13 +249,13 @@ public IActionResult GetDetail(Guid id)
}
///
- /// Updates the entity.
+ /// Updates an existing .
///
- /// The entity.
+ /// The .
/// The identifier.
- /// The updated entity.
- [HttpPut()]
- [Route("{id}/detail")]
+ /// The updated .
+ [AllowAnonymous]
+ [HttpPut("{id}/detail")]
[ProducesResponseType(typeof(PersonDetail), (int)HttpStatusCode.OK)]
public IActionResult UpdateDetail([FromBody] PersonDetail value, Guid id)
{
@@ -258,28 +264,28 @@ public IActionResult UpdateDetail([FromBody] PersonDetail value, Guid id)
}
///
- /// Patches the entity.
+ /// Patches an existing .
///
- /// The value that contains the patch content for the entity.
+ /// The that contains the patch content for the .
/// The identifier.
- /// The patched entity.
- [HttpPatch()]
- [Route("{id}/detail")]
+ /// The patched .
+ [AllowAnonymous]
+ [HttpPatch("{id}/detail")]
[ProducesResponseType(typeof(PersonDetail), (int)HttpStatusCode.OK)]
public IActionResult PatchDetail([FromBody] JToken value, Guid id)
{
- return new WebApiPatch(this, value, () => _manager.GetDetailAsync(id), (__value) => _manager.UpdateDetailAsync(__value, id),
+ return new WebApiPatch(this, value, () => _manager.GetDetailAsync(id), (__value) => _personManager.UpdateDetailAsync(__value, id),
operationType: OperationType.Update, statusCode: HttpStatusCode.OK, alternateStatusCode: null);
}
///
/// Actually validating the FromBody parameter generation.
///
- /// The Person (see ).
- [HttpPost]
- [Route("fromBody")]
+ /// The Person (see ).
+ [AllowAnonymous]
+ [HttpPost("fromBody")]
[ProducesResponseType((int)HttpStatusCode.Created)]
- public IActionResult Add([FromBody] Person? person)
+ public IActionResult Add([FromBody] Person person)
{
return new WebApiPost(this, () => _manager.AddAsync(person),
operationType: OperationType.Unspecified, statusCode: HttpStatusCode.Created);
@@ -289,9 +295,9 @@ public IActionResult Add([FromBody] Person? person)
/// Get Null.
///
/// The Name.
- /// A resultant .
- [HttpGet]
- [Route("null")]
+ /// A resultant .
+ [AllowAnonymous]
+ [HttpGet("null")]
[ProducesResponseType(typeof(Person), (int)HttpStatusCode.OK)]
[ProducesResponseType((int)HttpStatusCode.NotFound)]
public IActionResult GetNull(string? name)
@@ -301,14 +307,14 @@ public IActionResult GetNull(string? name)
}
///
- /// Gets the collection entity that matches the selection criteria.
+ /// Gets the that contains the items that match the selection criteria.
///
/// The First Name.
/// The Last Name.
- /// The Genders (see ).
- /// A .
- [HttpGet()]
- [Route("args")]
+ /// The Genders (see ).
+ /// The
+ [AllowAnonymous]
+ [HttpGet("args")]
[ProducesResponseType(typeof(PersonCollection), (int)HttpStatusCode.OK)]
[ProducesResponseType((int)HttpStatusCode.NoContent)]
public IActionResult GetByArgsWithEf(string? firstName = default, string? lastName = default, List? genders = default)
@@ -321,8 +327,8 @@ public IActionResult GetByArgsWithEf(string? firstName = default, string? lastNa
///
/// Throw Error.
///
- [HttpPost]
- [Route("error")]
+ [AllowAnonymous]
+ [HttpPost("error")]
[ProducesResponseType((int)HttpStatusCode.NoContent)]
public IActionResult ThrowError()
{
@@ -331,12 +337,12 @@ public IActionResult ThrowError()
}
///
- /// Gets the entity that matches the selection criteria.
+ /// Gets the specified .
///
/// The identifier.
- /// The selected entity where found.
- [HttpGet()]
- [Route("ef/{id}")]
+ /// The selected where found.
+ [AllowAnonymous]
+ [HttpGet("ef/{id}")]
[ProducesResponseType(typeof(Person), (int)HttpStatusCode.OK)]
[ProducesResponseType((int)HttpStatusCode.NotFound)]
public IActionResult GetWithEf(Guid id)
@@ -346,12 +352,12 @@ public IActionResult GetWithEf(Guid id)
}
///
- /// Creates the entity.
+ /// Creates a new .
///
- /// The entity.
- /// The created entity.
- [HttpPost()]
- [Route("ef")]
+ /// The .
+ /// The created .
+ [AllowAnonymous]
+ [HttpPost("ef")]
[ProducesResponseType(typeof(Person), (int)HttpStatusCode.Created)]
public IActionResult CreateWithEf([FromBody] Person value)
{
@@ -360,13 +366,13 @@ public IActionResult CreateWithEf([FromBody] Person value)
}
///
- /// Updates the entity.
+ /// Updates an existing .
///
- /// The entity.
+ /// The .
/// The identifier.
- /// The updated entity.
- [HttpPut()]
- [Route("ef/{id}")]
+ /// The updated .
+ [AllowAnonymous]
+ [HttpPut("ef/{id}")]
[ProducesResponseType(typeof(Person), (int)HttpStatusCode.OK)]
public IActionResult UpdateWithEf([FromBody] Person value, Guid id)
{
@@ -375,11 +381,11 @@ public IActionResult UpdateWithEf([FromBody] Person value, Guid id)
}
///
- /// Deletes the entity that matches the selection criteria.
+ /// Deletes the specified .
///
/// The identifier.
- [HttpDelete()]
- [Route("ef/{id}")]
+ [AllowAnonymous]
+ [HttpDelete("ef/{id}")]
[ProducesResponseType((int)HttpStatusCode.NoContent)]
public IActionResult DeleteWithEf(Guid id)
{
@@ -388,13 +394,13 @@ public IActionResult DeleteWithEf(Guid id)
}
///
- /// Patches the entity.
+ /// Patches an existing .
///
- /// The value that contains the patch content for the entity.
+ /// The that contains the patch content for the .
/// The identifier.
- /// The patched entity.
- [HttpPatch()]
- [Route("ef/{id}")]
+ /// The patched .
+ [AllowAnonymous]
+ [HttpPatch("ef/{id}")]
[ProducesResponseType(typeof(Person), (int)HttpStatusCode.OK)]
public IActionResult PatchWithEf([FromBody] JToken value, Guid id)
{
diff --git a/samples/Demo/Beef.Demo.Api/Controllers/Generated/ProductController.cs b/samples/Demo/Beef.Demo.Api/Controllers/Generated/ProductController.cs
index 3ad3e0a14..1ec967d90 100644
--- a/samples/Demo/Beef.Demo.Api/Controllers/Generated/ProductController.cs
+++ b/samples/Demo/Beef.Demo.Api/Controllers/Generated/ProductController.cs
@@ -21,26 +21,30 @@
namespace Beef.Demo.Api.Controllers
{
///
- /// Provides the Product Web API functionality.
+ /// Provides the Web API functionality.
///
+ [AllowAnonymous]
[Route("api/v1/products")]
public partial class ProductController : ControllerBase
{
private readonly IProductManager _manager;
-
+
///
/// Initializes a new instance of the class.
///
/// The .
- public ProductController(IProductManager manager) => _manager = Check.NotNull(manager, nameof(manager));
+ public ProductController(IProductManager manager)
+ { _manager = Check.NotNull(manager, nameof(manager)); ProductControllerCtor(); }
+
+ partial void ProductControllerCtor(); // Enables additional functionality to be added to the constructor.
///
- /// Gets the entity that matches the selection criteria.
+ /// Gets the specified .
///
/// The identifier.
- /// The selected entity where found.
- [HttpGet()]
- [Route("{id}")]
+ /// The selected where found.
+ [AllowAnonymous]
+ [HttpGet("{id}")]
[ProducesResponseType(typeof(Product), (int)HttpStatusCode.OK)]
[ProducesResponseType((int)HttpStatusCode.NotFound)]
public IActionResult Get(int id)
@@ -50,13 +54,13 @@ public IActionResult Get(int id)
}
///
- /// Gets the collection entity that matches the selection criteria.
+ /// Gets the that contains the items that match the selection criteria.
///
/// The Name.
/// The Description.
- /// A .
- [HttpGet()]
- [Route("")]
+ /// The
+ [AllowAnonymous]
+ [HttpGet("")]
[ProducesResponseType(typeof(ProductCollection), (int)HttpStatusCode.OK)]
[ProducesResponseType((int)HttpStatusCode.NoContent)]
public IActionResult GetByArgs(string? name = default, string? description = default)
diff --git a/samples/Demo/Beef.Demo.Api/Controllers/Generated/ReferenceDataController.cs b/samples/Demo/Beef.Demo.Api/Controllers/Generated/ReferenceDataController.cs
index 84a47535d..bfcd8fe2e 100644
--- a/samples/Demo/Beef.Demo.Api/Controllers/Generated/ReferenceDataController.cs
+++ b/samples/Demo/Beef.Demo.Api/Controllers/Generated/ReferenceDataController.cs
@@ -24,14 +24,16 @@ namespace Beef.Demo.Api.Controllers
///
/// Provides the ReferenceData Web API functionality.
///
+ [AllowAnonymous]
public partial class ReferenceDataController : ControllerBase
{
///
- /// Gets all of the reference data entities that match the specified criteria.
+ /// Gets all of the reference data items that match the specified criteria.
///
/// The reference data code list.
/// The reference data text (including wildcards).
- /// A collection.
+ /// A RefDataNamespace.Country collection.
+ [AllowAnonymous]
[HttpGet()]
[Route("api/v1/demo/ref/countries")]
[ProducesResponseType(typeof(IEnumerable), (int)HttpStatusCode.OK)]
@@ -41,11 +43,12 @@ public partial class ReferenceDataController : ControllerBase
operationType: OperationType.Read, statusCode: HttpStatusCode.OK, alternateStatusCode: HttpStatusCode.NoContent);
///
- /// Gets all of the reference data entities that match the specified criteria.
+ /// Gets all of the reference data items that match the specified criteria.
///
/// The reference data code list.
/// The reference data text (including wildcards).
- /// A collection.
+ /// A RefDataNamespace.USState collection.
+ [AllowAnonymous]
[HttpGet()]
[Route("api/v1/demo/ref/usStates")]
[ProducesResponseType(typeof(IEnumerable), (int)HttpStatusCode.OK)]
@@ -55,11 +58,12 @@ public partial class ReferenceDataController : ControllerBase
operationType: OperationType.Read, statusCode: HttpStatusCode.OK, alternateStatusCode: HttpStatusCode.NoContent);
///
- /// Gets all of the reference data entities that match the specified criteria.
+ /// Gets all of the reference data items that match the specified criteria.
///
/// The reference data code list.
/// The reference data text (including wildcards).
- /// A collection.
+ /// A RefDataNamespace.Gender collection.
+ [AllowAnonymous]
[HttpGet()]
[Route("api/v1/demo/ref/genders")]
[ProducesResponseType(typeof(IEnumerable), (int)HttpStatusCode.OK)]
@@ -69,11 +73,12 @@ public partial class ReferenceDataController : ControllerBase
operationType: OperationType.Read, statusCode: HttpStatusCode.OK, alternateStatusCode: HttpStatusCode.NoContent);
///
- /// Gets all of the reference data entities that match the specified criteria.
+ /// Gets all of the reference data items that match the specified criteria.
///
/// The reference data code list.
/// The reference data text (including wildcards).
- /// A collection.
+ /// A RefDataNamespace.EyeColor collection.
+ [AllowAnonymous]
[HttpGet()]
[Route("api/v1/demo/ref/eyeColors")]
[ProducesResponseType(typeof(IEnumerable), (int)HttpStatusCode.OK)]
@@ -83,11 +88,12 @@ public partial class ReferenceDataController : ControllerBase
operationType: OperationType.Read, statusCode: HttpStatusCode.OK, alternateStatusCode: HttpStatusCode.NoContent);
///
- /// Gets all of the reference data entities that match the specified criteria.
+ /// Gets all of the reference data items that match the specified criteria.
///
/// The reference data code list.
/// The reference data text (including wildcards).
- /// A collection.
+ /// A RefDataNamespace.PowerSource collection.
+ [AllowAnonymous]
[HttpGet()]
[Route("api/v1/demo/ref/powerSources")]
[ProducesResponseType(typeof(IEnumerable), (int)HttpStatusCode.OK)]
@@ -97,11 +103,12 @@ public partial class ReferenceDataController : ControllerBase
operationType: OperationType.Read, statusCode: HttpStatusCode.OK, alternateStatusCode: HttpStatusCode.NoContent);
///
- /// Gets all of the reference data entities that match the specified criteria.
+ /// Gets all of the reference data items that match the specified criteria.
///
/// The reference data code list.
/// The reference data text (including wildcards).
- /// A collection.
+ /// A RefDataNamespace.Company collection.
+ [AllowAnonymous]
[HttpGet()]
[Route("api/v1/demo/ref/companies")]
[ProducesResponseType(typeof(IEnumerable), (int)HttpStatusCode.OK)]
@@ -111,9 +118,10 @@ public partial class ReferenceDataController : ControllerBase
operationType: OperationType.Read, statusCode: HttpStatusCode.OK, alternateStatusCode: HttpStatusCode.NoContent);
///
- /// 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
+ /// Gets the reference data entries for the specified entities and codes from the query string; e.g: ?entity=codeX,codeY&entity2=codeZ&entity3
///
/// A .
+ [AllowAnonymous]
[HttpGet()]
[Route("api/v1/demo/ref")]
[ProducesResponseType(typeof(ReferenceDataMultiCollection), (int)HttpStatusCode.OK)]
diff --git a/samples/Demo/Beef.Demo.Api/Controllers/Generated/RobotController.cs b/samples/Demo/Beef.Demo.Api/Controllers/Generated/RobotController.cs
index af93005fc..1b1f47039 100644
--- a/samples/Demo/Beef.Demo.Api/Controllers/Generated/RobotController.cs
+++ b/samples/Demo/Beef.Demo.Api/Controllers/Generated/RobotController.cs
@@ -21,26 +21,30 @@
namespace Beef.Demo.Api.Controllers
{
///
- /// Provides the Robot Web API functionality.
+ /// Provides the Web API functionality.
///
+ [AllowAnonymous]
[Route("api/v1/robots")]
public partial class RobotController : ControllerBase
{
private readonly IRobotManager _manager;
-
+
///
/// Initializes a new instance of the class.
///
/// The .
- public RobotController(IRobotManager manager) => _manager = Check.NotNull(manager, nameof(manager));
+ public RobotController(IRobotManager manager)
+ { _manager = Check.NotNull(manager, nameof(manager)); RobotControllerCtor(); }
+
+ partial void RobotControllerCtor(); // Enables additional functionality to be added to the constructor.
///
- /// Gets the entity that matches the selection criteria.
+ /// Gets the specified .
///
/// The identifier.
- /// The selected entity where found.
- [HttpGet()]
- [Route("{id}")]
+ /// The selected where found.
+ [AllowAnonymous]
+ [HttpGet("{id}")]
[ProducesResponseType(typeof(Robot), (int)HttpStatusCode.OK)]
[ProducesResponseType((int)HttpStatusCode.NotFound)]
public IActionResult Get(Guid id)
@@ -50,12 +54,12 @@ public IActionResult Get(Guid id)
}
///
- /// Creates the entity.
+ /// Creates a new .
///
- /// The entity.
- /// The created entity.
- [HttpPost()]
- [Route("")]
+ /// The .
+ /// The created .
+ [AllowAnonymous]
+ [HttpPost("")]
[ProducesResponseType(typeof(Robot), (int)HttpStatusCode.Created)]
public IActionResult Create([FromBody] Robot value)
{
@@ -64,13 +68,13 @@ public IActionResult Create([FromBody] Robot value)
}
///
- /// Updates the entity.
+ /// Updates an existing .
///
- /// The entity.
+ /// The .
/// The identifier.
- /// The updated entity.
- [HttpPut()]
- [Route("{id}")]
+ /// The updated .
+ [AllowAnonymous]
+ [HttpPut("{id}")]
[ProducesResponseType(typeof(Robot), (int)HttpStatusCode.OK)]
public IActionResult Update([FromBody] Robot value, Guid id)
{
@@ -79,13 +83,13 @@ public IActionResult Update([FromBody] Robot value, Guid id)
}
///
- /// Patches the entity.
+ /// Patches an existing .
///
- /// The value that contains the patch content for the entity.
+ /// The that contains the patch content for the .
/// The identifier.
- /// The patched entity.
- [HttpPatch()]
- [Route("{id}")]
+ /// The patched .
+ [AllowAnonymous]
+ [HttpPatch("{id}")]
[ProducesResponseType(typeof(Robot), (int)HttpStatusCode.OK)]
public IActionResult Patch([FromBody] JToken value, Guid id)
{
@@ -94,11 +98,11 @@ public IActionResult Patch([FromBody] JToken value, Guid id)
}
///
- /// Deletes the entity that matches the selection criteria.
+ /// Deletes the specified .
///
/// The identifier.
- [HttpDelete()]
- [Route("{id}")]
+ [AllowAnonymous]
+ [HttpDelete("{id}")]
[ProducesResponseType((int)HttpStatusCode.NoContent)]
public IActionResult Delete(Guid id)
{
@@ -107,14 +111,14 @@ public IActionResult Delete(Guid id)
}
///
- /// Gets the collection entity that matches the selection criteria.
+ /// Gets the that contains the items that match the selection criteria.
///
/// The Model number.
/// The Unique serial number.
/// The Power Sources (see ).
- /// A .
- [HttpGet()]
- [Route("")]
+ /// The
+ [AllowAnonymous]
+ [HttpGet("")]
[ProducesResponseType(typeof(RobotCollection), (int)HttpStatusCode.OK)]
[ProducesResponseType((int)HttpStatusCode.NoContent)]
public IActionResult GetByArgs([FromQuery(Name = "model-no")] string? modelNo = default, [FromQuery(Name = "serial-no")] string? serialNo = default, [FromQuery(Name = "power-sources")] List? powerSources = default)
@@ -129,8 +133,8 @@ public IActionResult GetByArgs([FromQuery(Name = "model-no")] string? modelNo =
///
/// The identifier.
/// The Power Source (see ).
- [HttpPost]
- [Route("{id}/powerSource/{powerSource}")]
+ [AllowAnonymous]
+ [HttpPost("{id}/powerSource/{powerSource}")]
[ProducesResponseType((int)HttpStatusCode.Accepted)]
public IActionResult RaisePowerSourceChange(Guid id, string? powerSource)
{
diff --git a/samples/Demo/Beef.Demo.Api/Controllers/Generated/TripPersonController.cs b/samples/Demo/Beef.Demo.Api/Controllers/Generated/TripPersonController.cs
index 5fc359b39..ae0decabc 100644
--- a/samples/Demo/Beef.Demo.Api/Controllers/Generated/TripPersonController.cs
+++ b/samples/Demo/Beef.Demo.Api/Controllers/Generated/TripPersonController.cs
@@ -21,26 +21,30 @@
namespace Beef.Demo.Api.Controllers
{
///
- /// Provides the TripPerson Web API functionality.
+ /// Provides the Web API functionality.
///
+ [AllowAnonymous]
[Route("api/v1/tripPeople")]
public partial class TripPersonController : ControllerBase
{
private readonly ITripPersonManager _manager;
-
+
///
/// Initializes a new instance of the class.
///
/// The .
- public TripPersonController(ITripPersonManager manager) => _manager = Check.NotNull(manager, nameof(manager));
+ public TripPersonController(ITripPersonManager manager)
+ { _manager = Check.NotNull(manager, nameof(manager)); TripPersonControllerCtor(); }
+
+ partial void TripPersonControllerCtor(); // Enables additional functionality to be added to the constructor.
///
- /// Gets the entity that matches the selection criteria.
+ /// Gets the specified .
///
/// The identifier (username).
- /// The selected entity where found.
- [HttpGet()]
- [Route("{id}")]
+ /// The selected where found.
+ [AllowAnonymous]
+ [HttpGet("{id}")]
[ProducesResponseType(typeof(TripPerson), (int)HttpStatusCode.OK)]
[ProducesResponseType((int)HttpStatusCode.NotFound)]
public IActionResult Get(string? id)
@@ -50,12 +54,12 @@ public IActionResult Get(string? id)
}
///
- /// Creates the entity.
+ /// Creates a new .
///
- /// The entity.
- /// The created entity.
- [HttpPost()]
- [Route("")]
+ /// The .
+ /// The created .
+ [AllowAnonymous]
+ [HttpPost("")]
[ProducesResponseType(typeof(TripPerson), (int)HttpStatusCode.Created)]
public IActionResult Create([FromBody] TripPerson value)
{
@@ -64,13 +68,13 @@ public IActionResult Create([FromBody] TripPerson value)
}
///
- /// Updates the entity.
+ /// Updates an existing .
///
- /// The entity.
+ /// The .
/// The identifier (username).
- /// The updated entity.
- [HttpPut()]
- [Route("{id}")]
+ /// The updated .
+ [AllowAnonymous]
+ [HttpPut("{id}")]
[ProducesResponseType(typeof(TripPerson), (int)HttpStatusCode.OK)]
public IActionResult Update([FromBody] TripPerson value, string? id)
{
@@ -79,11 +83,11 @@ public IActionResult Update([FromBody] TripPerson value, string? id)
}
///
- /// Deletes the entity that matches the selection criteria.
+ /// Deletes the specified .
///
/// The identifier (username).
- [HttpDelete()]
- [Route("{id}")]
+ [AllowAnonymous]
+ [HttpDelete("{id}")]
[ProducesResponseType((int)HttpStatusCode.NoContent)]
public IActionResult Delete(string? id)
{
diff --git a/samples/Demo/Beef.Demo.Api/Grpc/Generated/RobotService.cs b/samples/Demo/Beef.Demo.Api/Grpc/Generated/RobotService.cs
index bbb31ea10..5572c8272 100644
--- a/samples/Demo/Beef.Demo.Api/Grpc/Generated/RobotService.cs
+++ b/samples/Demo/Beef.Demo.Api/Grpc/Generated/RobotService.cs
@@ -5,36 +5,44 @@
#nullable enable
#pragma warning disable IDE0005 // Using directive is unnecessary; are required depending on code-gen options
-using Beef.Demo.Business;
-using Beef.Grpc;
-using Grpc.Core;
using System;
using System.Net;
using System.Threading.Tasks;
+using Beef;
+using Beef.Grpc;
+using Grpc.Core;
+using Microsoft.AspNetCore.Authorization;
+using Beef.Demo.Business;
using Beef.Demo.Common.Grpc;
using Beef.Demo.Common.Grpc.Proto;
+using RefDataNamespace = Beef.Demo.Common.Entities;
namespace Beef.Demo.Api.Grpc
{
///
- /// Provides the Robot gRPC Server functionality.
+ /// Provides the gRPC Server functionality.
///
+ [AllowAnonymous]
public partial class RobotService : RobotGrpcService.RobotGrpcServiceBase
{
private readonly IRobotManager _manager;
-
+
///
/// Initializes a new instance of the class.
///
/// The .
- public RobotService(IRobotManager manager) => _manager = Check.NotNull(manager, nameof(manager));
+ public RobotService(IRobotManager manager)
+ { _manager = Check.NotNull(manager, nameof(manager)); ServiceCtor(); }
+
+ partial void ServiceCtor(); // Enables additional functionality to be added to the constructor.
///
- /// Gets the entity that matches the selection criteria.
+ /// Gets the specified .
///
/// The .
- /// The .
- /// A .
+ /// The .
+ /// The .
+ [AllowAnonymous]
public override Task Get(RobotGetRequest request, ServerCallContext context)
{
return new GrpcService(context, async () =>
@@ -46,11 +54,12 @@ public override Task Get(RobotGetRequest request, ServerCallContext conte
}
///
- /// Creates the entity.
+ /// Creates a new .
///
/// The .
- /// The .
- /// A .
+ /// The .
+ /// The .
+ [AllowAnonymous]
public override Task Create(RobotCreateRequest request, ServerCallContext context)
{
return new GrpcService(context, async () =>
@@ -62,11 +71,12 @@ public override Task Create(RobotCreateRequest request, ServerCallContext
}
///
- /// Updates the entity.
+ /// Updates an existing .
///
/// The .
- /// The .
- /// A .
+ /// The .
+ /// The .
+ [AllowAnonymous]
public override Task Update(RobotUpdateRequest request, ServerCallContext context)
{
return new GrpcService(context, async () =>
@@ -78,11 +88,12 @@ public override Task Update(RobotUpdateRequest request, ServerCallContext
}
///
- /// Deletes the entity that matches the selection criteria.
+ /// Deletes the specified .
///
/// The .
- /// The .
- /// A .
+ /// The .
+ /// The .
+ [AllowAnonymous]
public override Task Delete(RobotDeleteRequest request, ServerCallContext context)
{
return new GrpcService(context, async () =>
@@ -90,15 +101,16 @@ public override Task Update(RobotUpdateRequest request, ServerCallContext
var __req = request ?? new RobotDeleteRequest();
await _manager.DeleteAsync(Transformers.GuidToStringConverter.ConvertToSrce(__req.Id));
return new Google.Protobuf.WellKnownTypes.Empty();
- }, operationType: OperationType.Delete, statusCode: HttpStatusCode.NoContent, alternateStatusCode: null).ExecuteAsync();
+ }, operationType: OperationType.Delete, statusCode: HttpStatusCode.NoContent).ExecuteAsync();
}
///
- /// Gets the