Use pattern matching instead of HasValue

Proprietary

Replace 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.UsePatternMatchingInsteadOfHasValue
mod run . --recipe=OpenRewrite.Recipes.CSharp.CodeQuality.Simplification.UsePatternMatchingInsteadOfHasValue

Install it once, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.