C#

C#

Made by DeepSource

Consider rewriting Nullable<T> as T? CS-R1047

Anti-pattern
Major
Autofix

System.Nullable<T> indicates that the type T may be null. However, the said syntax can be shortened to T?. This is more concise, readable, and easy to comprehend, especially for programmers coming from languages such as TypeScript.

Bad Practice

Nullable<int> i = 0;

Recommended

int? i = 0;