Use coalesce expression
ProprietaryReplace x != null ? x : y and x == null ? y : x with x ?? y.
OpenRewrite. Recipes. CSharp. CodeQuality. Simplification. UseCoalesceExpressionmod run . --recipe= OpenRewrite. Recipes. CSharp. CodeQuality. Simplification. UseCoalesceExpressionInstall it once, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.