Class ContentTransformerBase<TPublish>
Base implementation for an object that can transform content of a specific content type
Inheritance
ContentTransformerBase<TPublish>
Namespace: Tableau.Migration.Engine.Hooks.Transformers
Assembly: Tableau.Migration.dll
Syntax
public abstract class ContentTransformerBase<TPublish> : IContentTransformer<TPublish>, IMigrationHook<TPublish> where TPublish : IContentReference
Type Parameters
Name | Description |
---|---|
TPublish |
Constructors
ContentTransformerBase(ISharedResourcesLocalizer, ILogger<IContentTransformer<TPublish>>)
Default constructor
Declaration
public ContentTransformerBase(ISharedResourcesLocalizer localizer, ILogger<IContentTransformer<TPublish>> logger)
Parameters
Type | Name | Description |
---|---|---|
ISharedResourcesLocalizer | localizer | A string localizer. |
ILogger<IContentTransformer<TPublish>> | logger | Default logger. |
Properties
Localizer
The string localizer.
Declaration
protected ISharedResourcesLocalizer Localizer { get; }
Property Value
Type | Description |
---|---|
ISharedResourcesLocalizer |
Logger
Default logger.
Declaration
protected ILogger<IContentTransformer<TPublish>> Logger { get; }
Property Value
Type | Description |
---|---|
ILogger<IContentTransformer<TPublish>> |
Methods
ExecuteAsync(TPublish, CancellationToken)
Executes a hook callback.
Declaration
public Task<TPublish?> ExecuteAsync(TPublish itemToTransform, CancellationToken cancel)
Parameters
Type | Name | Description |
---|---|---|
TPublish | itemToTransform | |
CancellationToken | cancel | The cancellation token to obey. |
Returns
Type | Description |
---|---|
Task<TPublish> | A task to await containing the context,
potentially modified to pass on to the next hook or migration engine,
or null to continue passing the same context as |
TransformAsync(TPublish, CancellationToken)
Executes the transformation.
Declaration
public abstract Task<TPublish?> TransformAsync(TPublish itemToTransform, CancellationToken cancel)
Parameters
Type | Name | Description |
---|---|---|
TPublish | itemToTransform | The input context from the migration engine or previous hook. |
CancellationToken | cancel | The cancellation token to obey. |
Returns
Type | Description |
---|---|
Task<TPublish> | A task to await containing the context,
potentially modified to pass on to the next hook or migration engine,
or null to continue passing the same context as |