Class ContentMappingBase<TContent>
Base implementation for an object that can map content of a specific content type.
Namespace: Tableau.Migration.Engine.Hooks.Mappings
Assembly: Tableau.Migration.dll
Syntax
public abstract class ContentMappingBase<TContent> : IContentMapping<TContent>, IMigrationHook<ContentMappingContext<TContent>> where TContent : IContentReference
Type Parameters
Name | Description |
---|---|
TContent |
Constructors
ContentMappingBase(ISharedResourcesLocalizer?, ILogger<IContentMapping<TContent>>?)
Default constructor for ContentMappingBase
Declaration
public ContentMappingBase(ISharedResourcesLocalizer? localizer, ILogger<IContentMapping<TContent>>? logger)
Parameters
Type | Name | Description |
---|---|---|
ISharedResourcesLocalizer | localizer | A string localizer. |
ILogger<IContentMapping<TContent>> | logger | Default logger. |
Properties
Localizer
The string localizer.
Declaration
protected ISharedResourcesLocalizer? Localizer { get; }
Property Value
Type | Description |
---|---|
ISharedResourcesLocalizer |
Logger
Default logger.
Declaration
protected ILogger<IContentMapping<TContent>>? Logger { get; }
Property Value
Type | Description |
---|---|
ILogger<IContentMapping<TContent>> |
Methods
ExecuteAsync(ContentMappingContext<TContent>, CancellationToken)
Executes a hook callback.
Declaration
public Task<ContentMappingContext<TContent>?> ExecuteAsync(ContentMappingContext<TContent> ctx, CancellationToken cancel)
Parameters
Type | Name | Description |
---|---|---|
ContentMappingContext<TContent> | ctx | The input context from the migration engine or previous hook. |
CancellationToken | cancel | The cancellation token to obey. |
Returns
Type | Description |
---|---|
Task<ContentMappingContext<TContent>> | 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 |
MapAsync(ContentMappingContext<TContent>, CancellationToken)
Executes the mapping.
Declaration
public abstract Task<ContentMappingContext<TContent>?> MapAsync(ContentMappingContext<TContent> ctx, CancellationToken cancel)
Parameters
Type | Name | Description |
---|---|---|
ContentMappingContext<TContent> | ctx | The input context from the migration engine or previous hook. |
CancellationToken | cancel | The cancellation token to obey. |
Returns
Type | Description |
---|---|
Task<ContentMappingContext<TContent>> | 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 |