{"id":21010186,"url":"https://github.com/hassanhabib/efxceptions","last_synced_at":"2025-05-15T02:34:02.226Z","repository":{"id":42210662,"uuid":"254987057","full_name":"hassanhabib/EFxceptions","owner":"hassanhabib","description":".NET Standard library to convert DbUpdateException into meaningful exceptions","archived":false,"fork":false,"pushed_at":"2023-10-11T21:23:04.000Z","size":107,"stargazers_count":31,"open_issues_count":12,"forks_count":21,"subscribers_count":6,"default_branch":"master","last_synced_at":"2023-10-12T03:17:31.946Z","etag":null,"topics":["entityframework","entityframeworkcore","exceptions","sql"],"latest_commit_sha":null,"homepage":"https://www.efxceptions.com","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hassanhabib.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2020-04-12T01:28:04.000Z","updated_at":"2023-10-09T20:37:59.000Z","dependencies_parsed_at":"2023-02-16T00:01:08.204Z","dependency_job_id":null,"html_url":"https://github.com/hassanhabib/EFxceptions","commit_stats":null,"previous_names":[],"tags_count":4,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hassanhabib%2FEFxceptions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hassanhabib%2FEFxceptions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hassanhabib%2FEFxceptions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hassanhabib%2FEFxceptions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hassanhabib","download_url":"https://codeload.github.com/hassanhabib/EFxceptions/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225324485,"owners_count":17456545,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["entityframework","entityframeworkcore","exceptions","sql"],"created_at":"2024-11-19T09:19:38.107Z","updated_at":"2024-11-19T09:19:38.655Z","avatar_url":"https://github.com/hassanhabib.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n\n\u003cp align=\"center\"\u003e\n  \u003cimg width=\"25%\" height=\"25%\" src=\"https://github.com/hassanhabib/EFxceptions/blob/master/EFxceptions.Shared/Resources/EFxceptions.png?raw=true\"\u003e\n\u003c/p\u003e\n\n[![.NET](https://github.com/hassanhabib/EFxceptions/actions/workflows/dotnet.yml/badge.svg)](https://github.com/hassanhabib/EFxceptions/actions/workflows/dotnet.yml)\n[![The Standard - COMPLIANT](https://img.shields.io/badge/The_Standard-COMPLIANT-2ea44f)](https://github.com/hassanhabib/The-Standard)\n\n# EFxceptions\n\n[![preview version](https://img.shields.io/nuget/vpre/EFxceptions)](https://www.nuget.org/packages/EFxceptions/absoluteLatest)\n\nWe have designed and developed this library as a wrapper around the existing EntityFramework DbContext implementation to provide the following values:\n\n\u003col\u003e\n\t\u003cli\u003eMeaningful Exceptions for SQL error codes.\u003c/li\u003e\n\t\u003cli\u003eSimplified integrations\u003c/li\u003e\n\t\u003cli\u003eTest-friendly implementation.\u003c/li\u003e\n\u003c/ol\u003e\n\n\u003cbr\u003e\n\n# EFxeptions.Identity\n[![preview version](https://img.shields.io/nuget/vpre/EFxceptions.Identity)](https://www.nuget.org/packages/EFxceptions.Identity/absoluteLatest)\n\nA dedicated EFxeptions port that provides an `EFxceptionContext` that inherits from `Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityDbContext` to inherit from, to support Microsoft ASP.Core Identity using EF Core.\nAvailable in the [EFxceptions.Identity](https://www.nuget.org/packages/EFxceptions.Identity) package.\n\n## Installation \nYou can get EFxceptions [Nuget](https://www.nuget.org/packages/EFxceptions/) package by typing:\n```powershell\nInstall-Package EFxceptions\n```\n\n\u003cbr\u003e\n\n## Integration\nReplace your existing ```DbContext``` class with ```EFxceptionsContext``` (or your `IdentityDbContext` with `EFxeption.EFxceptionIdentityContext`) as follows:\n\n#### Before:\n \n```csharp\n    public partial class StorageBroker : DbContext, IStorageBroker\n    {\n        public StorageBroker(DbContextOptions\u003cStorageBroker\u003e options)\n            : base(options) =\u003e this.Database.Migrate();\n    }\n\n```\n\n#### After:\n```csharp\n    public partial class StorageBroker : EFxceptionsContext, IStorageBroker\n    {\n        public StorageBroker(DbContextOptions\u003cStorageBroker\u003e options)\n            : base(options) =\u003e this.Database.Migrate();\n    }\n\n```\n\n\u003cbr\u003e\n\n## Supported SQL Error Codes\nSQL server supports over [41,000 error codes](https://docs.microsoft.com/en-us/sql/relational-databases/errors-events/database-engine-events-and-errors?view=sql-server-ver15), here's the codes that this library supports so far:\n\n\n|Code|Meanings|Exception|\n|--- |--- |--- |\n|207|Invalid column name '%.*ls'.|InvalidColumnNameException|\n|208|Invalid object name '%.*ls'.|InvalidObjectNameException|\n|547|The %ls statement conflicted with the %ls constraint \"%.*ls\". The conflict occurred in database \"%.*ls\", table \"%.*ls\"%ls%.*ls%ls.|ForeignKeyConstraintConflictException|\n|2627|Violation of %ls constraint '%.*ls'. Cannot insert duplicate key in object '%.*ls'.|DuplicateKeyException|\n\n\n\u003cbr \u003e\n\nThis library is forever growing as we add more exceptions and codes into it, we appreciate any contributions as there are so many codes we need to cover, so please stay tuned.\n\n\n\u003cbr /\u003e\n\nIf you have any suggestions, comments or questions, please feel free to contact me on:\n\u003cbr /\u003e\nTwitter: @hassanrezkhabib\n\u003cbr /\u003e\nLinkedIn: hassanrezkhabib\n\u003cbr /\u003e\nE-Mail: hassanhabib@live.com\n\u003cbr /\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhassanhabib%2Fefxceptions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhassanhabib%2Fefxceptions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhassanhabib%2Fefxceptions/lists"}