diff --git a/rules/S6932/csharp/rule.adoc b/rules/S6932/csharp/rule.adoc index c8575414a8c..51d0db97fbe 100644 --- a/rules/S6932/csharp/rule.adoc +++ b/rules/S6932/csharp/rule.adoc @@ -141,14 +141,6 @@ public ActionResult Post() var cultureName = Request.QueryString["locale"] ?? "en-US"; // Noncompliant: Request.QueryString // .. } - -public IActionResult Post() -{ - var origin = Request.Headers[HeaderNames.Origin]; // Compliant: Access via variable - var name = Request.Form["name"]; // Compliant: Access via constant and variable keys is mixed - var birthdate = DateTime.Parse(Request.Form["Birthdate"]); // Compliant: Access via constant and variable keys is mixed - // .. -} ---- ==== Compliant solution @@ -170,6 +162,14 @@ public ActionResult Post(User user, [Bind(Prefix = "locale")] string cultureName // ... } } + +public IActionResult Post() +{ + var origin = Request.Headers[HeaderNames.Origin]; // Compliant: Access via variable + var name = Request.Form["name"]; // Compliant: Access via constant and variable keys is mixed + var birthdate = DateTime.Parse(Request.Form["Birthdate"]); // Compliant: Access via constant and variable keys is mixed + // .. +} ---- include::../how-does-this-work.adoc[]