# InputsDialogValidationContext Methods

- Package: [Aspire.Hosting](/reference/api/csharp/aspire.hosting.md)
- Type: [InputsDialogValidationContext](/reference/api/csharp/aspire.hosting/inputsdialogvalidationcontext.md)
- Kind: `Methods`
- Members: `1`

Represents the context for validating inputs in an inputs dialog interaction.

## AddValidationError(InteractionInput, string)

- Name: `AddValidationError(InteractionInput, string)`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/bd20f904cde09ecb9c9ae5116a6f13614bf2d7c2/src/Aspire.Hosting/IInteractionService.cs#L524-L533)

Adds a validation error for the specified input.

```csharp
public sealed class InputsDialogValidationContext
{
    public void AddValidationError(
        InteractionInput input,
        string errorMessage)
    {
        // ...
    }
}
```

## Parameters

- `input` ([InteractionInput](/reference/api/csharp/aspire.hosting/interactioninput.md))
  The input to add a validation error for.
- `errorMessage` (`string`)
  The error message to add.
