Skip to content

Relax [TargetType] Constraints or Provide Strict Mode Toggle #57

Description

@tcortega

It's unfortunate that I'm forced to disable warnings using pragma when utilizing the GreaterThanAttribute with properties of type decimal or similar. For example:

[GreaterThan(0)]
public required decimal Amount { get; set; }

This results in the following warning:

Warning IV0015: Property/parameter `operand` is marked `[TargetType]`, but value is not of type `decimal`

Having a way to relax the constraints of [TargetType] or an option to toggle a strict mode would significantly improve this experience. Because this becomes unbearable if your project is treating warnings as errors.

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions