IdentityDbContext Constructor (DbConnection, DbCompiledModel, Boolean)
Initializes a new instance of the IdentityDbContext class using the existing connection to connect to a database, and initializes it from the given model. The connection will not be disposed when the context is disposed if contextOwnsConnection is false.
Namespace: Microsoft.AspNet.Identity.EntityFramework
Assembly: Microsoft.AspNet.Identity.EntityFramework (in Microsoft.AspNet.Identity.EntityFramework.dll)
Syntax
'Declaration
Public Sub New ( _
existingConnection As DbConnection, _
model As DbCompiledModel, _
contextOwnsConnection As Boolean _
)
'Usage
Dim existingConnection As DbConnection
Dim model As DbCompiledModel
Dim contextOwnsConnection As Boolean
Dim instance As New IdentityDbContext(existingConnection, _
model, contextOwnsConnection)
public IdentityDbContext(
DbConnection existingConnection,
DbCompiledModel model,
bool contextOwnsConnection
)
public:
IdentityDbContext(
DbConnection^ existingConnection,
DbCompiledModel^ model,
bool contextOwnsConnection
)
new :
existingConnection:DbConnection *
model:DbCompiledModel *
contextOwnsConnection:bool -> IdentityDbContext
public function IdentityDbContext(
existingConnection : DbConnection,
model : DbCompiledModel,
contextOwnsConnection : boolean
)
Parameters
- existingConnection
Type: System.Data.Common.DbConnection
An existing connection to use for the new context.
- model
Type: System.Data.Entity.Infrastructure.DbCompiledModel
The model that will back this context.
- contextOwnsConnection
Type: System.Boolean
Determines whether the context instance owns a connection. The connection will not be disposed when the context is disposed when this parameter is false.
See Also
Reference
Microsoft.AspNet.Identity.EntityFramework Namespace