@using
directive for component@using
directivenot
pattern matching syntax when a suppression operator is present. Place your cursor on the suppression operator. Press (Ctrl+.) to trigger the Quick Actions and Refactorings menu. Select Use pattern matching.<QualifiedMethodName>
to remove the inline method declaration:<QualifiedMethodName>
to preserve the original method declaration:<QualifiedType>
).Name to nameof(<QualifiedType>
) in C# and instances of GetType(<QualifiedType>
).Name to NameOf(<QualifiedType>
) in Visual Basic. Using nameof instead of the name of the type avoids the reflections involved when retrieving an object. Place your cursor within the typeof(<QualifiedType>
).Name. Press (Ctrl+.) to trigger the Quick Actions and Refactorings menu. Next, select from one of the following options:typeof
to nameof
:GetType
to NameOf
:in
keyword where the argument should not be passed by reference. Place your cursor on the error. Press (Ctrl+.) to trigger the Quick Actions and Refactorings menu. Select Remove ‘in’ keyword.is
where applicable, this code fix also suggests the pattern combinators and
, or
and not
when matching multiple different patterns and negating. Place your cursor inside the statement. Press (Ctrl+.) to trigger the Quick Actions and Refactorings menu. Select Use pattern matching.SuppressMessageAttributes
. Place your cursor on the pragma warning or the SuppressMessageAttribute
. Press (Ctrl+.) to trigger the Quick Actions and Refactorings menu. Select Remove unnecessary suppression.SuppressMessageAttribute
suppressions.