Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sql Server Constraints #123

Open
jacobglanz opened this issue Oct 27, 2024 · 0 comments
Open

Sql Server Constraints #123

jacobglanz opened this issue Oct 27, 2024 · 0 comments

Comments

@jacobglanz
Copy link

I have an idea I haven’t implemented yet. I’d like to know if you’d be open to merging it in if I develop it.

The concept is to automatically add predefined validations to the domain (like FluentValidation), and automatically add those validations as SQL Server Constraints.

Each type (e.g. string, int DateTime, etc.) would have it’s own extension method with optional parameters (e.g., name is a string, name.Validation(minLen: 5, maxLen: 25, trimBeforeValidating: true, etc).

Then I’d automatically add a method to set each property(e.g. SetName(), SetDescription()), and it will return an error or success, i'll use Source Generators to achieve that.

Additionally, I’d include an EF Core extension method AddErrorOrValidationAsSQLServerConstraints.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant