# IGrainExtensionBinder Methods

[Type overview](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.igrainextensionbinder/)

## GetExtension {#getextension-1-a9e793d1}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.igrainextensionbinder/methods/getextension-1-a9e793d1/)

```csharp
public abstract TExtensionInterface GetExtension<TExtensionInterface>()
```

Returns the grain extension registered for the provided `TExtensionInterface`.

### Returns

The implementation of the extension which is bound to this grain.

## GetOrSetExtension(Func&lt;TExtension&gt;) {#getorsetextension-2-system-func-textension-d90f3edf}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.igrainextensionbinder/methods/getorsetextension-2-system-func-textension-d90f3edf/)

```csharp
public abstract (TExtension, TExtensionInterface) IGrainExtensionBinder.GetOrSetExtension<TExtension, TExtensionInterface>(Func<TExtension> newExtensionFunc)
```

Binds an extension to an addressable object, if not already done.

### Parameters

- `newExtensionFunc` (`Func<TExtension>`): A factory function that constructs a new extension object.

### Returns

A tuple, containing first the extension and second an addressable reference to the extension's interface.
