---
title: 'ARC0001: Incorrect query method signature on ReadModel'
description: Return the read model itself or an accepted wrapper from a model-bound query.
---


<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. **Default severity: Error.** Move unrelated utility methods off the read model rather than exposing them as queries.

<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/)
