Interface IMigrationHookBuilder
Interface for an object that contains the hooks to execute at various points during the migration, determined by hook type.
Namespace: Tableau.Migration.Engine.Hooks
Assembly: Tableau.Migration.dll
Syntax
public interface IMigrationHookBuilder
Methods
Add(Type, IEnumerable<Type[]>)
Adds a factory to resolve the hook type.
Declaration
IMigrationHookBuilder Add(Type genericHookType, IEnumerable<Type[]> contentTypes)
Parameters
Type | Name | Description |
---|---|---|
Type | genericHookType | The generic type definition for the hook to execute. |
IEnumerable<Type[]> | contentTypes | The content types used to construct the hook types. |
Returns
Type | Description |
---|---|
IMigrationHookBuilder | The same hook builder object for fluent API calls. |
Add<THook>(Func<IServiceProvider, THook>?)
Adds a factory to resolve the hook type.
Declaration
IMigrationHookBuilder Add<THook>(Func<IServiceProvider, THook>? hookFactory = null) where THook : notnull
Parameters
Type | Name | Description |
---|---|---|
Func<IServiceProvider, THook> | hookFactory | An initializer function to create the object from, potentially from the migration-scoped dependency injection container. |
Returns
Type | Description |
---|---|
IMigrationHookBuilder | The same hook builder object for fluent API calls. |
Type Parameters
Name | Description |
---|---|
THook | The generic type to detect all hook types from. |
Add<THook>(THook)
Adds an object to be resolved when you build a hook for the content type.
Declaration
IMigrationHookBuilder Add<THook>(THook hook) where THook : notnull
Parameters
Type | Name | Description |
---|---|---|
THook | hook | The hook to execute. |
Returns
Type | Description |
---|---|
IMigrationHookBuilder | The same hook builder object for fluent API calls. |
Type Parameters
Name | Description |
---|---|
THook | The generic type to detect all hook types from. |
Add<THook, TContext>(Func<TContext, CancellationToken, Task<TContext?>>)
Adds a callback to be executed on the hook for the content type.
Declaration
IMigrationHookBuilder Add<THook, TContext>(Func<TContext, CancellationToken, Task<TContext?>> callback) where THook : IMigrationHook<TContext>
Parameters
Type | Name | Description |
---|---|---|
Func<TContext, CancellationToken, Task<TContext>> | callback | A callback to call for the hook. |
Returns
Type | Description |
---|---|
IMigrationHookBuilder | The same hook builder object for fluent API calls. |
Type Parameters
Name | Description |
---|---|
THook | The generic type to detect all hook types from. |
TContext | The hook's context type. |
Add<THook, TContext>(Func<TContext, TContext?>)
Adds a callback to be executed on the hook for the content type.
Declaration
IMigrationHookBuilder Add<THook, TContext>(Func<TContext, TContext?> callback) where THook : IMigrationHook<TContext>
Parameters
Type | Name | Description |
---|---|---|
Func<TContext, TContext> | callback | A synchronous callback to call for the hook. |
Returns
Type | Description |
---|---|
IMigrationHookBuilder | The same hook builder object for fluent API calls. |
Type Parameters
Name | Description |
---|---|
THook | The generic type to detect all hook types from. |
TContext | The hook's context type. |
Build()
Builds an immutable collection from the currently added hooks.
Declaration
IMigrationHookFactoryCollection Build()
Returns
Type | Description |
---|---|
IMigrationHookFactoryCollection | The created collection. |
Clear()
Removes all currently registered hooks.
Declaration
IMigrationHookBuilder Clear()
Returns
Type | Description |
---|---|
IMigrationHookBuilder | The same hook builder object for fluent API calls. |