Class ContentFilterBase<TContent>
Base implementation for an object that can filter content of a specific content type, to determine which content to migrate.
Inheritance
ContentFilterBase<TContent>
Namespace: Tableau.Migration.Engine.Hooks.Filters
Assembly: Tableau.Migration.dll
Syntax
public abstract class ContentFilterBase<TContent> : IContentFilter<TContent>, IMigrationHook<IEnumerable<ContentMigrationItem<TContent>>> where TContent : IContentReference
Type Parameters
Name | Description |
---|---|
TContent |
Constructors
ContentFilterBase(ISharedResourcesLocalizer?, ILogger<IContentFilter<TContent>>?)
Default constructor for ContentFilterBase
Declaration
public ContentFilterBase(ISharedResourcesLocalizer? localizer, ILogger<IContentFilter<TContent>>? logger)
Parameters
Type | Name | Description |
---|---|---|
ISharedResourcesLocalizer | localizer | A string localizer. |
ILogger<IContentFilter<TContent>> | logger | Default logger. |
Properties
Disabled
Gets or sets whether the filter is disabled.
Declaration
protected virtual bool Disabled { get; set; }
Property Value
Type | Description |
---|---|
bool |
Localizer
The string localizer.
Declaration
protected ISharedResourcesLocalizer? Localizer { get; }
Property Value
Type | Description |
---|---|
ISharedResourcesLocalizer |
Logger
Default logger.
Declaration
protected ILogger<IContentFilter<TContent>>? Logger { get; }
Property Value
Type | Description |
---|---|
ILogger<IContentFilter<TContent>> |
Methods
ExecuteAsync(IEnumerable<ContentMigrationItem<TContent>>, CancellationToken)
Executes a hook callback.
Declaration
public Task<IEnumerable<ContentMigrationItem<TContent>>?> ExecuteAsync(IEnumerable<ContentMigrationItem<TContent>> unfilteredItems, CancellationToken cancel)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<ContentMigrationItem<TContent>> | unfilteredItems | |
CancellationToken | cancel | The cancellation token to obey. |
Returns
Type | Description |
---|---|
Task<IEnumerable<ContentMigrationItem<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 |
ShouldMigrate(ContentMigrationItem<TContent>)
Checks if the item should be migrated.
Declaration
public abstract bool ShouldMigrate(ContentMigrationItem<TContent> item)
Parameters
Type | Name | Description |
---|---|---|
ContentMigrationItem<TContent> | item | The item to evaluate. |
Returns
Type | Description |
---|---|
bool | True if the item should be migrated. |