Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
zsolt-kolbay-sonarsource opened this issue May 30, 2024 · 0 comments · Fixed by #9361
Closed

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

zsolt-kolbay-sonarsource opened this issue May 30, 2024 · 0 comments · Fixed by #9361
Assignees
Labels
Area: C# C# rules related issues. Sprint: Hardening Fix FPs/FNs/improvements Type: False Positive Rule IS triggered when it shouldn't be.
Milestone

Comments

@zsolt-kolbay-sonarsource
Copy link
Contributor

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: C# C# rules related issues. Sprint: Hardening Fix FPs/FNs/improvements Type: False Positive Rule IS triggered when it shouldn't be.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants