← All recipes
Moderne licensed

Find calls that could use TimeProvider

Recipe IDOpenRewrite.Recipes.CSharp.CodeQuality.Performance.FindUseTimeProviderOverloadArtifactOpenRewrite.Recipes.CSharp.CodeQuality

Detect DateTime.UtcNow, DateTimeOffset.UtcNow, and Task.Delay calls that could use a TimeProvider parameter for better testability (.NET 8+).

Single recipecsharpperformancecode-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.Performance.FindUseTimeProviderOverload

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

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