Skip to content

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

@zsolt-kolbay-sonarsource

Description

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

Metadata

Metadata

Labels

False PositiveRule IS triggered when it shouldn't be.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions