Export (0) Print
Expand All

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
Protected method 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.
Public method 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.
Protected method 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.
Public method 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.
Public method DbContext(ObjectContext, Boolean) Constructs a new context instance around an existing ObjectContext.
Public method 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.
Public method 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.
Top
Show:
© 2014 Microsoft