Skip to content

[Idea] Strongly typed concrete exceptions using code generation #78

Description

@MaximS

Now the library provides common exceptions like unique constraint or check constraint violations.
The idea is to scan a DB for all available constrains, generate specific exception classes for them with names like Unique{constraint_name}Violation using Roslyn code generation and map DBUpdateException to this concrete exceptions.
Then the code could become something like:

try
{
  dbContext.SaveChanges();
}
catch UniqueEmailViolation e
{
  ...
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions