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

Add SmartEnumNameAttribute, a DataAnnotations ValidationAttribute #447

Merged

Conversation

sdepouw
Copy link
Collaborator

@sdepouw sdepouw commented Oct 16, 2023

  • Implements enhancement Add a ValidationAttribute to Validate Model Property Against SmartEnum Names #446
  • Add SmartEnumNameAttribute
    • Can be used in DataAnnotations contexts to validate a property against the Names of a specified SmartEnum
    • Configurable
      • Can customize error message, referencing the property validated and the list of valid SmartEnum Name values
      • Can specify whether or not case sensitivity is rquired
    • Allows nulls (expectation is that user will use [Required] to enforce no nulls)
  • Tests added for SmartEnumNameAttribute
  • Update README.md
    • Add documentation for SmartEnumNameAttribute
    • Fixed my name 😎
  • Update CONTRIBUTING.md to reference this project instead of Ardalis.GuardClauses

@ardalis
Copy link
Owner

ardalis commented Oct 17, 2023

Is this ready to merge?

@sdepouw
Copy link
Collaborator Author

sdepouw commented Oct 18, 2023

Is this ready to merge?

Yep, should be!

@sdepouw
Copy link
Collaborator Author

sdepouw commented Dec 12, 2023

@ardalis noticed this PR was still open. Should be good to go!

@ardalis ardalis merged commit 9f3dbec into ardalis:main Jan 16, 2024
1 check passed
@sdepouw sdepouw deleted the sdepouw/add-smartenum-validation-attribute branch January 16, 2024 20:54
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

Successfully merging this pull request may close these issues.

2 participants