# Add(T)

> Adds an element to the end of the buffer, resizing as necessary.

## Definition

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

```csharp
public int Add(T elem)
```

### Parameters

**** (T): The element to add to the buffer.

### Returns

| Type                                                       | Description                                                                               |
| ---------------------------------------------------------- | ----------------------------------------------------------------------------------------- |
| [int](https://learn.microsoft.com/dotnet/api/system.int32) | The index of the added element, which is equal to the new length of the buffer minus one. |

### Remarks

The buffer is resized if it has no additional capacity.
