# Class ExtensionCollection (3.27.1)

<button class="button button-with-icon cloud-select-dropdown__button " aria-haspopup="true">Version latest</button>

- [3.27.1 (latest)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.Reflection.ExtensionCollection)
- [3.23.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Protobuf/3.23.0/Google.Protobuf.Reflection.ExtensionCollection)
- [3.15.8](https://docs.cloud.google.com/dotnet/docs/reference/Google.Protobuf/3.15.8/Google.Protobuf.Reflection.ExtensionCollection)

    public sealed class ExtensionCollection

A collection to simplify retrieving the descriptors of extensions in a descriptor for a message

## Inheritance

[object](https://learn.microsoft.com/dotnet/api/system.object) \> ExtensionCollection

## Inherited Members

[object.Equals(object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object)) [object.Equals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object-system-object)) [object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) [object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) [object.ReferenceEquals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals) [object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)

## Namespace

[Google.Protobuf.Reflection](https://docs.cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.Reflection)

## Assembly

Google.Protobuf.dll

## Properties

### UnorderedExtensions

    public IList<FieldDescriptor> UnorderedExtensions { get; }

Returns a readonly list of all the extensions defined in this type in
the order they were defined in the source .proto file

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.collections.generic.ilist-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.Reflection.FieldDescriptor` |   |

## Methods

### GetExtensionsInDeclarationOrder(MessageDescriptor)

    public IList<FieldDescriptor> GetExtensionsInDeclarationOrder(MessageDescriptor descriptor)

Returns a readonly list of all the extensions define in this type that extend
the provided descriptor type in the order they were defined in the source .proto file

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `descriptor` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.Reflection.MessageDescriptor` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.collections.generic.ilist-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.Reflection.FieldDescriptor` |   |

### GetExtensionsInNumberOrder(MessageDescriptor)

    public IList<FieldDescriptor> GetExtensionsInNumberOrder(MessageDescriptor descriptor)

Returns a readonly list of all the extensions define in this type that extend
the provided descriptor type in ascending field order

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `descriptor` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.Reflection.MessageDescriptor` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.collections.generic.ilist-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.Reflection.FieldDescriptor` |   |