# GetComponentLookup<T>(bool)

> Manually gets a dictionary-like container containing all components of type T, keyed by Entity.

## Definition

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

```csharp
public ComponentLookup<T> GetComponentLookup<T>(bool isReadOnly = false) where T : unmanaged, IComponentData
```

### Parameters

**** (\[bool]\(https\://learn.microsoft.com/dotnet/api/system.boolean)): Whether the data is only read, not written. Access data as read-only whenever possible.

### Returns

| Type                                                                                      | Description                   |
| ----------------------------------------------------------------------------------------- | ----------------------------- |
| [ComponentLookup\<T>](/engine/7000.0/script-reference/unity/entities/componentlookup1.md) | All component data of type T. |

### Remarks

Remember to call [ComponentLookup\<T>.Update](/engine/7000.0/script-reference/unity/entities/componentlookup1/update.md).

Prefer using [SystemAPI.GetComponentLookup](/engine/7000.0/script-reference/unity/entities/systemapi/getcomponentlookup.md) as it will cache in OnCreate for you and call .Update(ref state) at the call-site.
