Interface IDataConverter<TSource, TTarget>
Service for converting a typed source object to a typed target object.
Inherited Members
Namespace: Kephas.Data.Conversion
Assembly: Kephas.Data.dll
Syntax
[AppServiceContract(ContractType = typeof(IDataConverter), AllowMultiple = true)]
public interface IDataConverter<in TSource, in TTarget> : IDataConverter
Type Parameters
| Name | Description |
|---|---|
| TSource | The source object type. |
| TTarget | The target object type. |
Methods
| Improve this Doc View SourceConvertAsync(TSource, TTarget, IDataConversionContext, CancellationToken)
Converts the source object to the target object asynchronously.
Declaration
Task<IDataConversionResult> ConvertAsync(TSource source, TTarget target, IDataConversionContext conversionContext, CancellationToken cancellationToken = default(CancellationToken))
Parameters
| Type | Name | Description |
|---|---|---|
| TSource | source | The source object. |
| TTarget | target | The target object. |
| IDataConversionContext | conversionContext | The conversion context. |
| System.Threading.CancellationToken | cancellationToken | The cancellation token (optional). |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<IDataConversionResult> | A data conversion result. |