Ignored method result (CA1806)
Dieser Inhalt ist noch nicht in deiner Sprache verfügbar.
Key dotnet.codequality.ignored-method-result · Severity warning · Category codequality
Microsoft analyzer CA1806. Flags a call whose only effect is its return value - a new string from Trim or Replace, a parsed number, a created object - being discarded. The call changes nothing.
Incorrect
Section titled “Incorrect”name.Trim();int.TryParse(input, out _);Correct
Section titled “Correct”name = name.Trim();if (!int.TryParse(input, out var count)) return BadRequest();