Skip to content

Extra ElseFalse property for BooleanTrueValuesAttribute and ElseTrue property for BooleanFalseValuesAttribute #2386

Description

@HenkJazit

When decorating a bool property with the BooleanTrueValuesAttribute, I would like the option to specify that the property should be set to false if none of the values match the input value and vice versa for the BooleanFalseValuesAttribute.

Possible complications:
Both BooleanTrueValuesAttribute and BooleanFalseValuesAttribute are used on a bool property and either or both have the additional "else" property set.
Suggested solution: Explicitly set values are first considered, if none match and only one of the "else" properties is set, that one is used. If both are set, it's a design choice if one takes precedence or an exception is thrown.

For nullable bool properties, a NullValuesAttribute is also considered before an "else" property is used.

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions