SonarSource/sonar-dotnet

Fix S6964 FP: Properties decorated with the [BindNever] attribute

Closed this issue · 0 comments

Description

The rule should not raise on properties that are decorated with the [BindNever] attribute, as those properties will not be populated during Model Binding.

Repro steps

public class Model
{
    [BindNever]
    public int Prop { get; set; } // FP
}

Related information

  • C#/VB.NET Plugins version: 9.25.1
  • Visual Studio version: 17.10.0
  • MSBuild / dotnet version: .NET 8.0
  • Operating System: Windows 10