I got a ContractClassFor
which generates a low of warnings with Code Analysis.
Example:
Microsoft.Usage : Parameter 'pageNumber' of 'IDocumentServiceContracts.GetItems(PrintQueue, int, int)' is never used. Remove the parameter or use it in the method body.
Do I have to use SupressMessage
for each parameter in each method in the contracts class? Or is it possible to get rid of the warnings in another way? I do want those warnings for all classes except contract classes.
A simple way is just to disable Code Analysis entirely for your contract classes, by putting the [GeneratedCode]
attribute on them. It's not really the right semantics but it does the job.
SuppressMessage is not very good in this scenario, since you can't apply it to classes. You'd have to apply it to each method, and that gets messy.