diff --git a/README.md b/README.md index bfcc841..78d6006 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,47 @@ +![STX.EFxceptions.Cosmos](https://raw.githubusercontent.com/The-Standard-Organization/STX.EFxceptions.Cosmos/main/Resources/Images/stx.efCosmos_git_logo.png) + +[![.Net](https://github.com/The-Standard-Organization/STX.EFxceptions.Cosmos/actions/workflows/dotnet.yml/badge.svg)](https://github.com/The-Standard-Organization/STX.EFxceptions.Cosmos/actions/workflows/dotnet.yml) +[![The Standard](https://img.shields.io/github/v/release/hassanhabib/The-Standard?filter=v2.10.0&style=default&label=Standard%20Version&color=2ea44f)](https://github.com/hassanhabib/The-Standard) +[![The Standard - COMPLIANT](https://img.shields.io/badge/The_Standard-COMPLIANT-2ea44f)](https://github.com/hassanhabib/The-Standard) +[![The Standard Community](https://img.shields.io/discord/934130100008538142?color=%237289da&label=The%20Standard%20Community&logo=Discord)](https://discord.gg/vdPZ7hS52X) + # STX.EFxceptions.Cosmos + +## Introduction A Standardized .NET library that captures the exceptions thrown by the EntityFramework from a Cosmos DB and converts them into meaningful exceptions... + +## STX. EFXceptions.Core Implementation + +[STX.EFxceptions.Core](https://github.com/The-Standard-Organization/STX.EFxceptions.Core) + +## Standard-Compliance +This library was built according to The Standard. The library follows engineering principles, patterns and tooling as recommended by The Standard. + +This library is also a community effort which involved many nights of pair-programming, test-driven development and in-depth exploration research and design discussions. + +## Standard-Promise +The most important fulfillment aspect in a Standard complaint system is aimed towards contributing to people, its evolution, and principles. +An organization that systematically honors an environment of learning, training, and sharing knowledge is an organization that learns from the past, makes calculated risks for the future, +and brings everyone within it up to speed on the current state of things as honestly, rapidly, and efficiently as possible. + +We believe that everyone has the right to privacy, and will never do anything that could violate that right. +We are committed to writing ethical and responsible software, and will always strive to use our skills, coding, and systems for the good. +We believe that these beliefs will help to ensure that our software(s) are safe and secure and that it will never be used to harm or collect personal data for malicious purposes. + +The Standard Community as a promise to you is in upholding these values. + +## Current Outlook of the Project +In the outset of this endeavor we plan to re-write the existing popular library RESTFulSense to enhance and bring current to modern Standard compliancy. + +## Contact + +If you have any suggestions, comments or questions, please feel free to contact me on: + +[Twitter](https://twitter.com/hassanrezkhabib) + +[LinkedIn](https://www.linkedin.com/in/hassanrezkhabib/) + +[E-Mail](mailto:hassanhabib@live.com) + +### Important Notice +A special thanks to Mr. Hassan Habib and Mr. Christo du Toit for their continuing dedicated contributions. \ No newline at end of file diff --git a/Resources/Diagrams/drawio.txt b/Resources/Diagrams/drawio.txt new file mode 100644 index 0000000..e69de29 diff --git a/Resources/Images/EFxceptions-Cosmos.png b/Resources/Images/EFxceptions-Cosmos.png new file mode 100644 index 0000000..1a2bdfe Binary files /dev/null and b/Resources/Images/EFxceptions-Cosmos.png differ diff --git a/Resources/Images/EFxceptions-Cosmos_128.png b/Resources/Images/EFxceptions-Cosmos_128.png new file mode 100644 index 0000000..cb5f436 Binary files /dev/null and b/Resources/Images/EFxceptions-Cosmos_128.png differ diff --git a/Resources/Images/EFxceptions-Cosmos_256.png b/Resources/Images/EFxceptions-Cosmos_256.png new file mode 100644 index 0000000..58db2a8 Binary files /dev/null and b/Resources/Images/EFxceptions-Cosmos_256.png differ diff --git a/Resources/Images/EFxceptions-Cosmos_48.png b/Resources/Images/EFxceptions-Cosmos_48.png new file mode 100644 index 0000000..109ecd6 Binary files /dev/null and b/Resources/Images/EFxceptions-Cosmos_48.png differ diff --git a/Resources/Images/EFxceptions-Cosmos_512.png b/Resources/Images/EFxceptions-Cosmos_512.png new file mode 100644 index 0000000..1a2bdfe Binary files /dev/null and b/Resources/Images/EFxceptions-Cosmos_512.png differ diff --git a/Resources/Images/stx.efCosmos_git_logo.png b/Resources/Images/stx.efCosmos_git_logo.png new file mode 100644 index 0000000..22b77d5 Binary files /dev/null and b/Resources/Images/stx.efCosmos_git_logo.png differ diff --git a/Resources/Images/stx.efxCosmos.icns b/Resources/Images/stx.efxCosmos.icns new file mode 100644 index 0000000..2ffd699 Binary files /dev/null and b/Resources/Images/stx.efxCosmos.icns differ diff --git a/Resources/Images/stx.efxCosmos.ico b/Resources/Images/stx.efxCosmos.ico new file mode 100644 index 0000000..5410fff Binary files /dev/null and b/Resources/Images/stx.efxCosmos.ico differ diff --git a/STX.EFxceptions.Cosmos/EFxceptionsContext.cs b/STX.EFxceptions.Cosmos/EFxceptionsContext.cs index c45fdce..690a1a5 100644 --- a/STX.EFxceptions.Cosmos/EFxceptionsContext.cs +++ b/STX.EFxceptions.Cosmos/EFxceptionsContext.cs @@ -3,6 +3,7 @@ // ---------------------------------------------------------------------------------- using Microsoft.Azure.Cosmos; +using Microsoft.EntityFrameworkCore; using STX.EFxceptions.Core; using STX.EFxceptions.Cosmos.Base.Brokers.DbErrorBroker; using STX.EFxceptions.Cosmos.Base.Services.Foundations; @@ -13,11 +14,21 @@ namespace STX.EFxceptions.Cosmos { public class EFxceptionsContext : DbContextBase { + public EFxceptionsContext(DbContextOptions options) + : base(options) + { } + + protected EFxceptionsContext() + : base() + { } + protected override IDbErrorBroker CreateErrorBroker() => new CosmosErrorBroker(); protected override IEFxceptionService CreateEFxceptionService( - IDbErrorBroker errorBroker) => - new CosmosEFxceptionService(errorBroker); + IDbErrorBroker errorBroker) + { + return new CosmosEFxceptionService(errorBroker); + } } } diff --git a/STX.EFxceptions.Identity.Cosmos/EFxceptionsIdentityContext.cs b/STX.EFxceptions.Identity.Cosmos/EFxceptionsIdentityContext.cs index 35d3a9f..b26f947 100644 --- a/STX.EFxceptions.Identity.Cosmos/EFxceptionsIdentityContext.cs +++ b/STX.EFxceptions.Identity.Cosmos/EFxceptionsIdentityContext.cs @@ -21,10 +21,10 @@ public class EFxceptionsIdentityContext where TRole : IdentityRole where TKey : IEquatable { - protected EFxceptionsIdentityContext() + public EFxceptionsIdentityContext(DbContextOptions options) : base(options) { } - public EFxceptionsIdentityContext(DbContextOptions options) : base(options) + protected EFxceptionsIdentityContext() : base() { } protected override IDbErrorBroker CreateErrorBroker() => @@ -48,6 +48,12 @@ public class EFxceptionsIdentityContext< where TRoleClaim : IdentityRoleClaim where TUserToken : IdentityUserToken { + public EFxceptionsIdentityContext(DbContextOptions options) : base(options) + { } + + protected EFxceptionsIdentityContext() : base() + { } + protected override IDbErrorBroker CreateErrorBroker() => new CosmosErrorBroker();