# ConversionDelegate<TSource, TTarget> delegate

Namespace: [Grasshopper2.Types.Conversion](https://developer.rhino3d.com/api/gh2/namespace/grasshopper2.types.conversion.md) · Assembly: [Grasshopper2](https://developer.rhino3d.com/api/gh2/assembly/grasshopper2.md)

```cs
public delegate ConversionDelegate<TSource, TTarget>
```

Method signature for automatic type conversions. A valid conversion delegate *must* be decorated with a [MeritAttribute](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.conversion.meritattribute.md) and may be decorated with a [ExplanationAttribute](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.conversion.explanationattribute.md). If the conversion fails due to some reason, an exception must be thrown whose message explains the failure reason. Note that the [ConversionRepository](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.conversion.conversionrepository.md) class has many helper methods for throwing these exceptions.

**Type parameters:**

- `in TSource`: Type to convert from.
- `TTarget`: Type to convert to.

**Signature:**

```cs
void ConversionDelegate<TSource, TTarget>(TSource source, out TTarget target)
```

**Parameters:**

- `source` (`TSource`): Data to convert.
- `target` (out `TTarget`): Target of conversion.
