IdentityDbContext<TUser> Constructor
Initializes a new instance of the IdentityDbContext<TUser> class.
Namespace: Microsoft.AspNet.Identity.EntityFramework
Assembly: Microsoft.AspNet.Identity.EntityFramework (in Microsoft.AspNet.Identity.EntityFramework.dll)
Overload List
Name | Description | |
---|---|---|
![]() |
IdentityDbContext<TUser>() | Initializes a new instance of the IdentityDbContext<TUser> class which uses the DefaultConnection. |
![]() |
IdentityDbContext<TUser>(DbConnection, DbCompiledModel, Boolean) | Initializes a new instance of the IdentityDbContext<TUser> 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. |
![]() |
IdentityDbContext<TUser>(String) | Initializes a new instance of the IdentityDbContext<TUser> class which takes the connection string to use. |
![]() |
IdentityDbContext<TUser>(String, Boolean) | Initializes a new instance of the IdentityDbContext<TUser> class which takes the connection string to use. |
See Also
IdentityDbContext<TUser> Class
Microsoft.AspNet.Identity.EntityFramework Namespace
ASP.NET Identity
Return to top
IdentityDbContext<TUser> Constructor ()
Initializes a new instance of the IdentityDbContext<TUser> class which uses the DefaultConnection.
Syntax
public IdentityDbContext()
public:
IdentityDbContext()
new : unit -> IdentityDbContext
Public Sub New
See Also
Return to top
IdentityDbContext<TUser> Constructor (DbConnection, DbCompiledModel, Boolean)
Initializes a new instance of the IdentityDbContext<TUser> 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.
Syntax
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 Sub New (
existingConnection As DbConnection,
model As DbCompiledModel,
contextOwnsConnection As Boolean
)
Parameters
existingConnection
Type: System.Data.Common.DbConnectionAn existing connection to use for the new context.
model
Type: System.Data.Entity.Infrastructure.DbCompiledModelThe model that will back this context.
contextOwnsConnection
Type: System.BooleanDetermines whether the context owns a connection. The connection will not be disposed when the context is disposed when this parameter is false.
See Also
Return to top
IdentityDbContext<TUser> Constructor (String)
Initializes a new instance of the IdentityDbContext<TUser> class which takes the connection string to use.
Syntax
public IdentityDbContext(
string nameOrConnectionString
)
public:
IdentityDbContext(
String^ nameOrConnectionString
)
new :
nameOrConnectionString:string -> IdentityDbContext
Public Sub New (
nameOrConnectionString As String
)
Parameters
nameOrConnectionString
Type: System.StringThe name or connection string.
See Also
Return to top
IdentityDbContext<TUser> Constructor (String, Boolean)
Initializes a new instance of the IdentityDbContext<TUser> class which takes the connection string to use.
Syntax
public IdentityDbContext(
string nameOrConnectionString,
bool throwIfV1Schema
)
public:
IdentityDbContext(
String^ nameOrConnectionString,
bool throwIfV1Schema
)
new :
nameOrConnectionString:string *
throwIfV1Schema:bool -> IdentityDbContext
Public Sub New (
nameOrConnectionString As String,
throwIfV1Schema As Boolean
)
Parameters
nameOrConnectionString
Type: System.StringThe name or connection string.
throwIfV1Schema
Type: System.BooleanDetermines whether to throw an exception if the schema matches that of Identity 1.0.0.
See Also
Return to top