# AppendToBuffer<T>(Entity, T)

> Records a command to append a single element to the end of a dynamic buffer component.

## Definition

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

```csharp
public void AppendToBuffer<T>(Entity e, T element) where T : struct, IBufferElementData
```

### Parameters

**** (\[Entity]\(/engine/7000.0/script-reference/unity/entities/entity)): The entity to which the dynamic buffer belongs.**** (T): The new element to add to the [DynamicBuffer\<T>](/engine/7000.0/script-reference/unity/entities/dynamicbuffer1.md) component.

### Remarks

At playback this command throws an error if the entity is destroyed before playback, or if the entity doesn't have a [DynamicBuffer\<T>](/engine/7000.0/script-reference/unity/entities/dynamicbuffer1.md) component that stores elements of type T.
