Skip to content

Add SmartEnumNameAttribute, a DataAnnotations ValidationAttribute#447

Merged
ardalis merged 17 commits intoardalis:mainfrom
sdepouw:sdepouw/add-smartenum-validation-attribute
Jan 16, 2024
Merged

Add SmartEnumNameAttribute, a DataAnnotations ValidationAttribute#447
ardalis merged 17 commits intoardalis:mainfrom
sdepouw:sdepouw/add-smartenum-validation-attribute

Conversation

@sdepouw
Copy link
Copy Markdown
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
Copy Markdown
Owner

ardalis commented Oct 17, 2023

Is this ready to merge?

@sdepouw
Copy link
Copy Markdown
Collaborator Author

sdepouw commented Oct 18, 2023

Is this ready to merge?

Yep, should be!

@sdepouw
Copy link
Copy Markdown
Collaborator Author

sdepouw commented Dec 12, 2023

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

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