Skip to content

ARC0005: Value produced by Provide is not consumed by Handle

When a command declares Provide(), each produced value must have a compatible Handle() parameter. The analyzer unwraps Task<T>, ValueTask<T>, tuples, and OneOf-based result alternatives. It accepts identity or implicit conversions to a handler parameter. Default severity: Warning.

Control values that short-circuit execution instead of feeding Handle are exempt: ValidationResult, collections of ValidationResult, AuthorizationResult, and CommandResult.

Compile these alternatives separately with Cratis.Arc.Core. They illustrate data flow only; the first intentionally produces ARC0005.

using Cratis.Arc.Commands.ModelBound;
[Command]
public record NormalizeName(string Name)
{
public string Provide() => Name.Trim();
public string Handle() => Name;
}

Provide() produces a trimmed string, but the handler ignores it. Consume the provided value:

using Cratis.Arc.Commands.ModelBound;
[Command]
public record NormalizeName(string Name)
{
public string Provide() => Name.Trim();
public string Handle(string normalizedName) => normalizedName;
}

The string is an ordinary response, not an event. See Provide data to a command handler for dependency-backed examples and short-circuit behavior.