Class MigrationHookBuilder
Default IMigrationHookBuilder implementation.
Implements
Inherited Members
Namespace: Tableau.Migration.Engine.Hooks
Assembly: Tableau.Migration.dll
Syntax
public class MigrationHookBuilder : MigrationHookBuilderBase, IMigrationHookBuilder
Methods
Add(Type, IEnumerable<Type[]>)
Adds a factory to resolve the hook type.
Declaration
public virtual 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
public virtual 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
public virtual 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
public virtual 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
public 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. |
Clear()
Removes all currently registered hooks.
Declaration
public IMigrationHookBuilder Clear()
Returns
Type | Description |
---|---|
IMigrationHookBuilder | The same hook builder object for fluent API calls. |