---
title: 'ARC0003: Handle() must be on [Command] type'
description: Keep a model-bound command's handler on the command rather than in an external handler class.
---


<a id="severity"></a>

## Rule

Reports a public instance `Handle()` method on a non-command type when a parameter is a `[Command]` type. Move that behavior onto the command itself. **Default severity: Error.**

<a id="example"></a>
<a id="violation"></a>

## Diagnostic example

Compile these alternatives separately with `Cratis.Arc.Core`. The external handler deliberately triggers ARC0003. The command already has `Handle()` to avoid an unrelated ARC0004 diagnostic; it returns sample data, not persisted state.

```csharp
using Cratis.Arc.Commands.ModelBound;

[Command]
public record NormalizeName(string Name)
{
    public string Handle() => Name;
}

public class NormalizeNameHandler
{
    public string Handle(NormalizeName command) => command.Name.Trim();
}
```

<a id="fix"></a>

Remove the external handler and put its behavior on the command:

```csharp
using Cratis.Arc.Commands.ModelBound;

[Command]
public record NormalizeName(string Name)
{
    public string Handle() => Name.Trim();
}
```

These declarations illustrate handler placement; they are not complete host programs. See [model-bound commands](/arc/backend/csharp/commands/model-bound/) for the execution model.
