C# – IDE0060: Remove unused parameter

If you have a method with a parameter, and that parameter is not used in the method, then you’ll get the IDE0060 message telling you to remove the unused parameter. Here’s an example of code that would trigger this message: The encrypt parameter isn’t being used in the Send() method, triggering the IDE0060 message: IDE0060 … Read more

CA1062: Validate parameter is non-null before using it

When you have a public method that isn’t null checking its parameters, then you’ll get the CA1062 code analysis warning. For example, the following code isn’t null checking the movieRepository parameter: This results in the CA1062 code analysis warning: CA1062 In externally visible method ‘void StreamingService.LogMovies(MovieRepository movieRepository)’, validate parameter ‘movieRepository’ is non-null before using it. … Read more