For several reasons we prefer Nullable<Int32>
over int?
. Wherever possible we prefer Types over keywords - as we do so since C#2 we have a large codebase already using that style.
I recently switched to VS2015 and got the annoying light bulbs all over my code. For Int32
and other related non-generic types I fixed that by using this answer. For Nullable<T>
however I cannot find the option to disable nagging.
How do I disable the IDE0001 Name can be simplified.
for Nullable<T>
?
In your project properties, under the Build tab, in "Errors and warnings", add IDE0001
to the set of suppressed warnings. I know this isn't really a warning (just a suggestion) but it's the same infrastructure. That removes the suggestion.
See more on this question at Stackoverflow