DbContext Constructor
Entity Framework 5.0
Initializes a new instance of the DbContext class.
This member is overloaded. For complete information about this member, including syntax, usage, and examples, click a name in the overload list.
| Name | Description | |
|---|---|---|
|
DbContext() | Constructs a new context instance using conventions to create the name of the database to which a connection will be made. By convention the name is the full name (namespace + class name) of the derived context class. For more information on how this is used to create a connection, see the remarks section for DbContext. |
|
DbContext(String) | Constructs a new context instance using the given string as the name or connection string for the database to which a connection will be made. For more information on how this is used to create a connection, see the remarks section for DbContext. |
|
DbContext(DbCompiledModel) | Constructs a new context instance using conventions to create the name of the database to which a connection will be made, and initializes it from the given model. By convention the name is the full name (namespace + class name) of the derived context class. For more information on how this is used to create a connection, see the remarks section for DbContext. |
|
DbContext(DbConnection, Boolean) | Constructs a new context instance using the existing connection to connect to a database. The connection will not be disposed when the context is disposed. |
|
DbContext(ObjectContext, Boolean) | Constructs a new context instance around an existing ObjectContext. |
|
DbContext(String, DbCompiledModel) | Constructs a new context instance using the given string as the name or connection string for the database to which a connection will be made, and initializes it from the given model. For more information on how this is used to create a connection, see the remarks section for DbContext. |
|
DbContext(DbConnection, DbCompiledModel, Boolean) | Constructs a new context instance 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. |
Show: