---
title: 'ARC0024: Generated value names must be non-empty and unique'
editUrl: https://github.com/Cratis/Arc/edit/main/Documentation/backend/csharp/code-analysis/ARC0024.md
description: Give each generated Handle parameter a distinct, non-empty, case-sensitive name.
---


## Rule

Each generated parameter resolves its name from `[GeneratedValue("name")]`, or from the
C# parameter name when no explicit name is supplied. Names must not be empty or whitespace,
and must be unique within the command's effective `Handle()` method using ordinal,
case-sensitive comparison. This includes inherited handlers. The rule reports the later
parameter and the effective command when names collide, even if the parameters have
different types. **Default severity: Error.**

## Diagnostic example

The examples use this identifier, the same declaration as in
[generated values](/arc/backend/csharp/commands/generated-values/):

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

public record CartId(Guid Value) : ConceptAs<Guid>(Value), IGeneratable<CartId>
{
    public static CartId New() => new(GenerateValue.Uuid());
}
```

Compile each alternative below together with it, one at a time; the first
intentionally produces ARC0024.

```csharp
[Command]
public record AllocateCartIds
{
    public (CartId First, CartId Second) Handle(
        [GeneratedValue] CartId first,
        [GeneratedValue("first")] CartId second) => (first, second);
}
```

## Fix

Use distinct explicit names, or let each parameter use its own name:

```csharp
[Command]
public record AllocateCartIds
{
    public (CartId First, CartId Second) Handle(
        [GeneratedValue("first")] CartId first,
        [GeneratedValue("second")] CartId second) => (first, second);
}
```

Explicit names keep scenario pins stable across parameter renames.
`"cart"` and `"Cart"` are distinct names; different commands can reuse either name.
