Code Analysis Rules
This section documents the code analysis rules provided by the Arc.Core code analyzer for .NET.
Arc.Core includes Roslyn analyzers that validate Arc constructs at compile time to catch errors early and enforce best practices.
All rules follow the identifier format ARC#### where the numbers are sequential without gaps.
Rules Overview
Section titled “Rules Overview”| Rule ID | Title | Severity | Description |
|---|---|---|---|
| ARC0001 | Incorrect query method signature on ReadModel | Error | ReadModel query methods must return the ReadModel type or an allowed wrapper of it. |
| ARC0002 | Missing [Command] attribute on command-like type | Warning | Command-like types must be marked with [Command] to be recognized as commands. |
| ARC0003 | Handle() must be on [Command] type | Error | Public command Handle() methods must be declared on the command type itself. |
| ARC0004 | [Command] type must have public Handle() method | Error | Types marked with [Command] must declare a public instance Handle() method. |
Quick Fixes
Section titled “Quick Fixes”No automatic code fixes are currently provided for these rules.
Installation
Section titled “Installation”The analyzer is automatically included when you reference Arc.Core in your project. No additional configuration is required.
<ItemGroup> <ProjectReference Include="../Arc.Core/Arc.Core.csproj" /></ItemGroup>