Class MigrationContext
The default implementation of the IMigrationContext
Implements
Inherited Members
Namespace: FluentMigrator.Infrastructure
Assembly: FluentMigrator.dll
Syntax
public class MigrationContext : IMigrationContext
Constructors
| Edit this page View SourceMigrationContext(IQuerySchema, IAssemblyCollection, object, string)
Initializes a new instance of the MigrationContext class.
Declaration
[Obsolete]
public MigrationContext(IQuerySchema querySchema, IAssemblyCollection migrationAssemblies, object context, string connection)
Parameters
Type | Name | Description |
---|---|---|
IQuerySchema | querySchema | The provider used to query the database |
IAssemblyCollection | migrationAssemblies | The collection of migration assemblies |
object | context | The arbitrary application context passed to the task runner |
string | connection | The database connection |
MigrationContext(IQuerySchema, IServiceProvider, object, string)
Initializes a new instance of the MigrationContext class.
Declaration
public MigrationContext(IQuerySchema querySchema, IServiceProvider serviceProvider, object context, string connection)
Parameters
Type | Name | Description |
---|---|---|
IQuerySchema | querySchema | The provider used to query the database |
IServiceProvider | serviceProvider | The service provider |
object | context | The arbitrary application context passed to the task runner |
string | connection | The database connection |
Properties
| Edit this page View SourceApplicationContext
Gets or sets the arbitrary application context passed to the task runner
Declaration
[Obsolete("Use dependency injection to access 'application state'.")]
public virtual object ApplicationContext { get; set; }
Property Value
Type | Description |
---|---|
object |
Connection
Gets or sets the connection string
Declaration
public string Connection { get; set; }
Property Value
Type | Description |
---|---|
string |
Expressions
Gets or sets the collection of expressions
Declaration
public virtual ICollection<IMigrationExpression> Expressions { get; set; }
Property Value
Type | Description |
---|---|
ICollection<IMigrationExpression> |
MigrationAssemblies
Gets or sets the collection of migration assemblies
Declaration
[Obsolete]
public virtual IAssemblyCollection MigrationAssemblies { get; set; }
Property Value
Type | Description |
---|---|
IAssemblyCollection |
QuerySchema
Gets the IQuerySchema to access the database
Declaration
public virtual IQuerySchema QuerySchema { get; set; }
Property Value
Type | Description |
---|---|
IQuerySchema |
ServiceProvider
Gets the service provider used to create this migration context
Declaration
public IServiceProvider ServiceProvider { get; }
Property Value
Type | Description |
---|---|
IServiceProvider |