Add null checks for all parameters
This refactoring applies to:
- C#
What: Creates and adds if
statements that check nullity of all the nullable, non-checked parameters.
When: You want to quickly add null checks for all applicable method parameters.
Why: Writing null checks for many parameters can be time consuming and repetitive. Using this refactoring is quick and makes the program more robust.
How-to
Place your cursor on any parameter within the method.
Press Ctrl+. to trigger the Quick Actions and Refactorings menu.
Select the option to Add null checks for all parameters.
See also
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for