# SystemTarget.GetOrSetExtension(Func&lt;TExtension&gt;)

[Type overview](/orleans/docs/api/csharp/microsoft.orleans.runtime/orleans.runtime.systemtarget/) | [Methods](/orleans/docs/api/csharp/microsoft.orleans.runtime/orleans.runtime.systemtarget/methods/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Runtime/Core/SystemTarget.cs#L275-L293)

```csharp
public (TExtension, TExtensionInterface) SystemTarget.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.
