---
title: 'ARC0001: Incorrect query method signature on ReadModel'
editUrl: https://github.com/Cratis/Arc/edit/main/Documentation/backend/csharp/code-analysis/ARC0001.md
description: ARC0001 reports unsupported return types on Cratis Arc read-model queries. Return the read model itself or an accepted query wrapper.
lastUpdated: 2026-11-05T00:00:00.000Z
---


<a id="severity"></a>
<a id="why-this-rule-exists"></a>

## Rule

Reports public static non-void methods on `[ReadModel]` types whose return type is not the read model or an accepted wrapper. Methods accepting their own read-model type, nullable or not, are excluded from query discovery and this diagnostic, regardless of parameter name or position. **Default severity: Error.** Move unrelated utility methods off the read model rather than exposing them as queries, or use [explicit endpoint selection](/arc/backend/csharp/queries/model-bound/static-methods/#choose-endpoints-explicitly-when-a-model-has-helpers).

<a id="valid-return-types"></a>

## Accepted return shapes

For read model `T`, the analyzer accepts:

- `T` and `T[]`
- `IEnumerable<T>` and types implementing it, including `List<T>` and `IQueryable<T>`
- `Task<T>` and `Task<C>` where `C` is an accepted collection of `T`
- `IAsyncEnumerable<T>`
- `ISubject<T>` and `ISubject<C>` where `C` is an accepted collection of `T`

These are type shapes, not declarations to paste into a file. A nongeneric `Task` and `ValueTask<T>` are not accepted by this analyzer. For transport behavior, see [query return types](/arc/backend/csharp/queries/model-bound/return-types/).

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

## Diagnostic example

Compile each block separately with `Cratis.Arc.Core`. The first intentionally produces ARC0001; it is not a runnable application.

```csharp
using System;
using Cratis.Arc.Queries.ModelBound;

[ReadModel]
public record User(Guid Id, string Name)
{
    public static string GetName(Guid id) => "Ada";
}
```

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

Return the read model instead:

```csharp
using System;
using Cratis.Arc.Queries.ModelBound;

[ReadModel]
public record User(Guid Id, string Name)
{
    public static User GetById(Guid id) => new(id, "Ada");
}
```

This fixed declaration returns sample data; it does not demonstrate database persistence or host setup. Both declarations use records so ARC0008 does not distract from the return-type error.

## Related rules

- [ARC0014: Generic query methods](/arc/backend/csharp/code-analysis/#arc0014-generic-query-methods)
- [ARC0002: Missing command attribute](/arc/backend/csharp/code-analysis/arc0002/)
