Use pattern matching instead of HasValue
ProprietaryReplace nullable.HasValue with nullable is not null. Pattern matching is more idiomatic in modern C#. Note: this recipe uses name-based matching and may match non-Nullable types with a HasValue property.
OpenRewrite. Recipes. CSharp. CodeQuality. Simplification. UsePatternMatchingInsteadOfHasValuemod run . --recipe= OpenRewrite. Recipes. CSharp. CodeQuality. Simplification. UsePatternMatchingInsteadOfHasValueInstall it once, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.