# WithAny

> Specify optional read-only component types.

## Definition

* **Type:** Method
* **Namespace:** [Unity.Entities](/engine/7000.0/script-reference/unity/entities.md)
* **Assembly:** UnityEngine.EntitiesModule

## WithAny\<T>()

Specify optional read-only component types.

```csharp
public QueryEnumerableWithEntity<T1, T2, T3, T4, T5> WithAny<TComponent1>()
```

### Returns

| Type                                                                                                                      | Description                                                                                                                                                      |
| ------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [QueryEnumerableWithEntity\<T, U, V, W, X>](/engine/7000.0/script-reference/unity/entities/queryenumerablewithentity5.md) | QueryEnumerableWithEntity, which allows enumerating over all RefRO, RefRW, components, EnabledRefRO, EnabledRefRW and entities that match the constructed Query. |

## WithAny\<T, U>()

Specify optional read-only component types.

```csharp
public QueryEnumerableWithEntity<T1, T2, T3, T4, T5> WithAny<TComponent1, TComponent2>()
```

### Returns

| Type                                                                                                                      | Description                                                                                                                                                      |
| ------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [QueryEnumerableWithEntity\<T, U, V, W, X>](/engine/7000.0/script-reference/unity/entities/queryenumerablewithentity5.md) | QueryEnumerableWithEntity, which allows enumerating over all RefRO, RefRW, components, EnabledRefRO, EnabledRefRW and entities that match the constructed Query. |

## WithAny\<T, U, V>()

Specify optional read-only component types.

```csharp
public QueryEnumerableWithEntity<T1, T2, T3, T4, T5> WithAny<TComponent1, TComponent2, TComponent3>()
```

### Returns

| Type                                                                                                                      | Description                                                                                                                                                      |
| ------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [QueryEnumerableWithEntity\<T, U, V, W, X>](/engine/7000.0/script-reference/unity/entities/queryenumerablewithentity5.md) | QueryEnumerableWithEntity, which allows enumerating over all RefRO, RefRW, components, EnabledRefRO, EnabledRefRW and entities that match the constructed Query. |
