# GetMetadatas<T>()

> Enumerates every metadata item of the given type.

## Definition

* **Type:** Method
* **Namespace:** [Unity.Localization](/engine/6000.7/script-reference/unity/localization.md)
* **Assembly:** UnityEngine.LocalizationRuntimeModule

```csharp
public IEnumerable<T> GetMetadatas<T>() where T : class, IMetadata
```

### Returns

| Type                                                                                               | Description                                |
| -------------------------------------------------------------------------------------------------- | ------------------------------------------ |
| [IEnumerable\<T>](https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1) | A sequence of the items assignable to `T`. |

### Remarks

Items are returned in the order they were added. Use [MetadataCollection.GetMetadata](/engine/6000.7/script-reference/unity/localization/metadatacollection/getmetadata.md) when you only need the first match.

Iterate every comment attached to a collection.

### Examples

```csharp
using System.Collections.Generic;
using Unity.Localization;

namespace Unity.Localization.Samples
{
    public class MetadataCollectionGetMetadatasExample
    {
        public IEnumerable<Comment> Run(MetadataCollection metadata)
            => metadata.GetMetadatas<Comment>();
    }
}
```
