# InteractionInputCollection Indexers

- Package: [Aspire.Hosting](/reference/api/csharp/aspire.hosting.md)
- Type: [InteractionInputCollection](/reference/api/csharp/aspire.hosting/interactioninputcollection.md)
- Kind: `Indexers`
- Members: `2`

A collection of interaction inputs that supports both indexed and name-based access.

## this[string]

- Name: `this[string]`
- Modifiers: `get`
- Returns: [InteractionInput](/reference/api/csharp/aspire.hosting/interactioninput.md)

Gets an input by its name.

```csharp
public InteractionInput this[string name] { get; }
```

## Parameters

- `name` (`string`)
  The name of the input.

## Returns

[InteractionInput](/reference/api/csharp/aspire.hosting/interactioninput.md) -- The input with the specified name.

## Exceptions

- `KeyNotFoundException` -- Thrown when no input with the specified name exists.

## this[int]

- Name: `this[int]`
- Modifiers: `get`
- Returns: [InteractionInput](/reference/api/csharp/aspire.hosting/interactioninput.md)

Gets an input by its index.

```csharp
public InteractionInput this[int index] { get; }
```

## Parameters

- `index` (`int`)
  The zero-based index of the input.

## Returns

[InteractionInput](/reference/api/csharp/aspire.hosting/interactioninput.md) -- The input at the specified index.
