From 34ff5eb0be362ddd4f3a40d275f7db2de29797f4 Mon Sep 17 00:00:00 2001 From: JJ Bussert Date: Tue, 15 Apr 2025 20:14:25 -0500 Subject: [PATCH 1/8] Creating a new simple DomainException to help Identify what layers an exception originates from --- src/E13.Common.Domain/DomainException.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 src/E13.Common.Domain/DomainException.cs diff --git a/src/E13.Common.Domain/DomainException.cs b/src/E13.Common.Domain/DomainException.cs new file mode 100644 index 0000000..89cd972 --- /dev/null +++ b/src/E13.Common.Domain/DomainException.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace E13.Common.Domain +{ + public class DomainException : Exception + { + } +} From 14b36f819017d364aabfa3b3c77455b6123cce47 Mon Sep 17 00:00:00 2001 From: JJ Bussert Date: Tue, 15 Apr 2025 20:34:44 -0500 Subject: [PATCH 2/8] Add E13.Common.Data project Updated solution to include new project for data . Updated solution to include existing project for logic. Modified CI/CD pipeline to include jobs for new projects. Established project references and dependencies in relevant files. Introduced custom exception classes for data and logic errors. Initialized E13.Common.Data project with .NET 9.0 settings. --- E13.Common.sln | 14 ++++++++++ build/cd.yml | 26 +++++++++++++------ .../E13.Common.Data.Db.csproj | 1 + src/E13.Common.Data/DataException.cs | 7 +++++ src/E13.Common.Data/E13.Common.Data.csproj | 9 +++++++ src/E13.Common.Logic/LogicException.cs | 23 ++++++++++++++++ 6 files changed, 72 insertions(+), 8 deletions(-) create mode 100644 src/E13.Common.Data/DataException.cs create mode 100644 src/E13.Common.Data/E13.Common.Data.csproj create mode 100644 src/E13.Common.Logic/LogicException.cs diff --git a/E13.Common.sln b/E13.Common.sln index 4a56124..38c5ca4 100644 --- a/E13.Common.sln +++ b/E13.Common.sln @@ -41,6 +41,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "E13.Common.Cli", "src\E13.C EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{02EA681E-C7D8-13C7-8484-4AC65E1B71E8}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "E13.Common.Data", "src\E13.Common.Data\E13.Common.Data.csproj", "{427C6EBD-6302-46D5-849D-A9AE04B4649E}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "E13.Common.Logic", "src\E13.Common.Logic\E13.Common.Logic.csproj", "{58E89B10-C7EF-4FFC-AE45-BB0EB7FB2A99}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -115,6 +119,14 @@ Global {A96111A4-8348-4EB7-A7D7-8DDA857D7414}.Debug|Any CPU.Build.0 = Debug|Any CPU {A96111A4-8348-4EB7-A7D7-8DDA857D7414}.Release|Any CPU.ActiveCfg = Release|Any CPU {A96111A4-8348-4EB7-A7D7-8DDA857D7414}.Release|Any CPU.Build.0 = Release|Any CPU + {427C6EBD-6302-46D5-849D-A9AE04B4649E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {427C6EBD-6302-46D5-849D-A9AE04B4649E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {427C6EBD-6302-46D5-849D-A9AE04B4649E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {427C6EBD-6302-46D5-849D-A9AE04B4649E}.Release|Any CPU.Build.0 = Release|Any CPU + {58E89B10-C7EF-4FFC-AE45-BB0EB7FB2A99}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {58E89B10-C7EF-4FFC-AE45-BB0EB7FB2A99}.Debug|Any CPU.Build.0 = Debug|Any CPU + {58E89B10-C7EF-4FFC-AE45-BB0EB7FB2A99}.Release|Any CPU.ActiveCfg = Release|Any CPU + {58E89B10-C7EF-4FFC-AE45-BB0EB7FB2A99}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -137,6 +149,8 @@ Global {E57FB194-8742-4183-8FBF-0EDA6C09F4A6} = {30D836B3-FF29-49DC-B503-94B8F9B6DC50} {F05A8C35-D9A8-48C6-8709-9E009AEC84C1} = {30D836B3-FF29-49DC-B503-94B8F9B6DC50} {A96111A4-8348-4EB7-A7D7-8DDA857D7414} = {02EA681E-C7D8-13C7-8484-4AC65E1B71E8} + {427C6EBD-6302-46D5-849D-A9AE04B4649E} = {02EA681E-C7D8-13C7-8484-4AC65E1B71E8} + {58E89B10-C7EF-4FFC-AE45-BB0EB7FB2A99} = {02EA681E-C7D8-13C7-8484-4AC65E1B71E8} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {86FB5264-87DD-494C-885E-05EA38F8DB19} diff --git a/build/cd.yml b/build/cd.yml index 3de8f18..c41ceae 100644 --- a/build/cd.yml +++ b/build/cd.yml @@ -82,7 +82,7 @@ stages: - template: templates/job_nuget_github.yml parameters: name: data - project: E13.Common.Data.Db + project: E13.Common.Data - template: templates/job_nuget_github.yml parameters: @@ -92,6 +92,11 @@ stages: - stage: Batch3 dependsOn: Batch2 jobs: + - template: templates/job_nuget_github.yml + parameters: + name: datadb + project: E13.Common.Data.Db + - template: templates/job_nuget_github.yml parameters: name: api @@ -102,26 +107,31 @@ stages: name: blazor project: E13.Common.Blazor - - template: templates/job_nuget_github.yml - parameters: - name: logic - project: E13.Common.Logic - - template: templates/job_nuget_github.yml parameters: name: nunit_ui project: E13.Common.Nunit.UI - + - stage: Batch4 dependsOn: Batch3 jobs: + + - template: templates/job_nuget_github.yml + parameters: + name: logic + project: E13.Common.Logic + +- stage: Batch5 + dependsOn: Batch4 + jobs: + - template: templates/job_nuget_github.yml parameters: name: nunit_api project: E13.Common.Nunit.Api - stage: Post - dependsOn: Batch4 + dependsOn: Batch5 jobs: - job: git_cleanup steps: diff --git a/src/E13.Common.Data.Db/E13.Common.Data.Db.csproj b/src/E13.Common.Data.Db/E13.Common.Data.Db.csproj index ca36f15..a52f039 100644 --- a/src/E13.Common.Data.Db/E13.Common.Data.Db.csproj +++ b/src/E13.Common.Data.Db/E13.Common.Data.Db.csproj @@ -42,6 +42,7 @@ + diff --git a/src/E13.Common.Data/DataException.cs b/src/E13.Common.Data/DataException.cs new file mode 100644 index 0000000..f0cc7cc --- /dev/null +++ b/src/E13.Common.Data/DataException.cs @@ -0,0 +1,7 @@ +namespace E13.Common.Data +{ + public class DataException : Exception + { + + } +} diff --git a/src/E13.Common.Data/E13.Common.Data.csproj b/src/E13.Common.Data/E13.Common.Data.csproj new file mode 100644 index 0000000..125f4c9 --- /dev/null +++ b/src/E13.Common.Data/E13.Common.Data.csproj @@ -0,0 +1,9 @@ + + + + net9.0 + enable + enable + + + diff --git a/src/E13.Common.Logic/LogicException.cs b/src/E13.Common.Logic/LogicException.cs new file mode 100644 index 0000000..9507b2c --- /dev/null +++ b/src/E13.Common.Logic/LogicException.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace E13.Common.Logic +{ + public class LogicException : Exception + { + public LogicException() + { + } + + public LogicException(string message) : base(message) + { + } + + public LogicException(string message, Exception innerException) : base(message, innerException) + { + } + } +} From cb7811443d6b2e9fbb7701153569909d9b84585b Mon Sep 17 00:00:00 2001 From: JJ Bussert Date: Tue, 15 Apr 2025 20:39:28 -0500 Subject: [PATCH 3/8] auto updated doc --- doc/E13.Common.Core.xml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/doc/E13.Common.Core.xml b/doc/E13.Common.Core.xml index 0d3e331..187a855 100644 --- a/doc/E13.Common.Core.xml +++ b/doc/E13.Common.Core.xml @@ -52,6 +52,17 @@ the Guid representation of the string that was constructed + + + Environment variables used by E13.Common + + + + + Checks if the InMemory environment variable is set to true + + false if "InMemory" has a value of "false" or is not set, true otherwise + Helpers used to help getting settings primarily for unit test execution @@ -135,6 +146,7 @@ enum to extend DisplayAttribute.StringValue + Thrown if the enum does not have an Attribute of type DisplayAttribute or if the enum itself was not found @@ -142,6 +154,7 @@ enum to extend AbbrevationAttribute.StringValue + Thrown if the enum does not have an Attribute of type AbbrevationAttribute or if the enum itself was not found @@ -149,6 +162,18 @@ enum to extend GuidAttribute.Value + Thrown if the enum does not have an Attribute of type GuidAttribute or if the enum itself was not found + + + + Private method used by other extension methods to get an appropriate value for an enum's attribute + + Attribute Type to be resolved to retrieve the value + Type of the value to be returned + enum value + Function to resolve the return value + + Thrown if the enum does not have an Attribute of TAttributeType or if the enum itself was not found From 9f4893ce4fffafbc20dfda96477c00665d6f8c7b Mon Sep 17 00:00:00 2001 From: JJ Bussert Date: Tue, 15 Apr 2025 20:45:25 -0500 Subject: [PATCH 4/8] Add E13.Common.Data documentation to README.md Updated README.md to include a new section for the E13.Common.Data package. This includes an overview, features, installation instructions, dependencies, related packages, contribution guidelines, and licensing information to improve documentation and usability. --- src/E13.Common.Data/docs/README.md | 38 ++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 src/E13.Common.Data/docs/README.md diff --git a/src/E13.Common.Data/docs/README.md b/src/E13.Common.Data/docs/README.md new file mode 100644 index 0000000..22e4817 --- /dev/null +++ b/src/E13.Common.Data/docs/README.md @@ -0,0 +1,38 @@ +# E13.Common.Data + +[![NuGet Version](https://img.shields.io/nuget/v/e13.common.data)](https://www.nuget.org/packages/E13.Common.Data/) +[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT) + +## Overview + +E13.Common.Data is a package within the E13.Common collection designed for implementing a data layers. + +## Features + +- **Data Exception**: Exception to help identify data-related issues + +## Installation + +```shell +dotnet add package E13.Common.Data +``` + +## Dependencies + +- .NET 9.0 + +## Related Packages + +E13.Common.Data is part of the E13.Common collection, which includes: + +- E13.Common.Core - Core utilities and base classes +- E13.Common.Domain - Domain layer components +- E13.Common.Data.Db - Database access components + +## Contributing + +Contributions to E13.Common.Data are welcome. If you have suggestions or improvements, please submit an issue or create a pull request in the [GitHub repository](https://github.com/e13tech/common). + +## License + +This project is licensed under the MIT License. For more details, see the LICENSE file in the repository. From 8db8456116f78906119ced2883d69795be857a56 Mon Sep 17 00:00:00 2001 From: JJ Bussert <16327051+JJBussert@users.noreply.github.com> Date: Wed, 16 Apr 2025 08:21:10 -0500 Subject: [PATCH 5/8] Update src/E13.Common.Domain/DomainException.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- src/E13.Common.Domain/DomainException.cs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/E13.Common.Domain/DomainException.cs b/src/E13.Common.Domain/DomainException.cs index 89cd972..8062472 100644 --- a/src/E13.Common.Domain/DomainException.cs +++ b/src/E13.Common.Domain/DomainException.cs @@ -8,5 +8,19 @@ namespace E13.Common.Domain { public class DomainException : Exception { + // Default constructor + public DomainException() : base() + { + } + + // Constructor with message + public DomainException(string message) : base(message) + { + } + + // Constructor with message and inner exception + public DomainException(string message, Exception innerException) : base(message, innerException) + { + } } } From 1f773d428a5c34ca3d6d5f3942ec6ed6f424752e Mon Sep 17 00:00:00 2001 From: JJ Bussert <16327051+JJBussert@users.noreply.github.com> Date: Wed, 16 Apr 2025 08:22:07 -0500 Subject: [PATCH 6/8] Update build/cd.yml Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- build/cd.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/build/cd.yml b/build/cd.yml index c41ceae..90c46a9 100644 --- a/build/cd.yml +++ b/build/cd.yml @@ -122,7 +122,8 @@ stages: project: E13.Common.Logic - stage: Batch5 - dependsOn: Batch4 + dependsOn: + - Batch4 jobs: - template: templates/job_nuget_github.yml From 6f896427d18c283ea211499c3deb59d360b47c3a Mon Sep 17 00:00:00 2001 From: JJ Bussert <16327051+JJBussert@users.noreply.github.com> Date: Wed, 16 Apr 2025 08:22:18 -0500 Subject: [PATCH 7/8] Update src/E13.Common.Data/docs/README.md Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- src/E13.Common.Data/docs/README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/E13.Common.Data/docs/README.md b/src/E13.Common.Data/docs/README.md index 22e4817..d0aaf38 100644 --- a/src/E13.Common.Data/docs/README.md +++ b/src/E13.Common.Data/docs/README.md @@ -5,8 +5,7 @@ ## Overview -E13.Common.Data is a package within the E13.Common collection designed for implementing a data layers. - +E13.Common.Data is a package within the E13.Common collection designed for implementing a data layer. ## Features - **Data Exception**: Exception to help identify data-related issues From 876d4260af6dde4b08bf69d4a054791fd1b27c7e Mon Sep 17 00:00:00 2001 From: JJ Bussert <16327051+JJBussert@users.noreply.github.com> Date: Wed, 16 Apr 2025 08:22:32 -0500 Subject: [PATCH 8/8] Update src/E13.Common.Data/DataException.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- src/E13.Common.Data/DataException.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/E13.Common.Data/DataException.cs b/src/E13.Common.Data/DataException.cs index f0cc7cc..0b0231b 100644 --- a/src/E13.Common.Data/DataException.cs +++ b/src/E13.Common.Data/DataException.cs @@ -2,6 +2,13 @@ { public class DataException : Exception { + // Parameterless constructor + public DataException() : base() { } + // Constructor with message + public DataException(string message) : base(message) { } + + // Constructor with message and inner exception + public DataException(string message, Exception innerException) : base(message, innerException) { } } }