ARC0002: Missing [Command] attribute on command-like type
Types that look like commands (properties plus Handle methods) must be marked with [Command] to be recognized as commands.
Severity
Section titled “Severity”Warning
Example
Section titled “Example”Violation
Section titled “Violation”public record CreateUser{ public string Name { get; set; }
// ARC0002: Missing [Command] attribute public void Handle() { // Command logic }}[Command]public record CreateUser{ public string Name { get; set; } public string Email { get; set; }
public void Handle() { // Command logic }}[Command]public record CreateUser{ public string Name { get; set; }
public UserCreatedResult Handle() { return new UserCreatedResult { UserId = Guid.NewGuid() }; }}Why This Rule Exists
Section titled “Why This Rule Exists”Commands are identified by the [Command] attribute. Without it:
- Handlers are not discovered by the runtime.
- Validation and metadata generation are incomplete.
- Command routing becomes inconsistent across the system.
Related Rules
Section titled “Related Rules”- ARC0001: Incorrect query method signature on ReadModel