ReSharper seems to think there is no use case for having a validation method like so:
private static void ValidatePdfOptions(PdfOptions options)
if(options.Sections == null || options.Sections.Length == 0)
throw new Exception("At least one PdfSectionOptions instance must be supplied");
if(options.Sections.Any(o => string.IsNullOrWhiteSpace(o.DocumentHtml)))
throw new InvalidOperationException("DocumentHtml cannot be null or whitespace");
ReSharper says: Parameter 'options' is only used for precondition check(s)
I don't want to put this method on the class because the validation I'm applying is only applicable under certain conditions. Why does ReSharper care whether or not I have a method like this, and why does it want to turn off all
"unused parameter" warnings in order to disable this warning? The parameter is not
unused as if I were to remove it, the code obviously wouldn't compile, yet if I turn this warning off and have an actual
unused parameter, ReSharper won't warn me about it.
Could someone please explain what I'm missing here?