Skip to content

Fix S6964 FN: Rule should raise in case of value type property annotated with RequiredAttribute #9263

@hugoqribeiro

Description

@hugoqribeiro

Description

S6964 is reporting an error on value type model properties.

Repro steps

Here is a value type model property that is triggering the rule:

public class ChangeEmailCodeViewModel : VerificationCodeViewModelBase
{
  public int CanRetry
  {
      get;
      set;
  }

  // (...)
}

Expected behavior

The rule should not be trigger for value type properties.

Actual behavior

See above.

Known workarounds

None.

Related information

  • SonarAnalyzer.CSharp version 9.25.0.90414
  • Visual Studio 17.9.6
  • .NET 8.0.204
  • Windows 10

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions