← All recipes
Moderne licensed

Declare the coerce and validate callback value parameter nullable

Recipe IDOpenRewrite.Recipes.CSharp.CodeQuality.Wpf.MakeCallbackParameterNullableArtifactOpenRewrite.Recipes.CSharp.CodeQuality

WPF calls a CoerceValueCallback and a ValidateValueCallback with a null value, so the value parameter should be declared object?. Only applies where nullable reference types are enabled, whether by a #nullable directive or by <Nullable> in the project.

Single recipecsharpcode-qualityProprietary

Usage

This recipe has no required configuration options. You’ll need the Moderne CLI configured before running the command below.

mod run . --recipe OpenRewrite.Recipes.CSharp.CodeQuality.Wpf.MakeCallbackParameterNullable

If the recipe isn’t available locally, install it with:

mod config recipes nuget install OpenRewrite.Recipes.CSharp.CodeQuality