Export (0) Print
Expand All

DbContext Constructor (String, DbCompiledModel)

Entity Framework 5.0

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.

Namespace:  System.Data.Entity
Assembly:  EntityFramework (in EntityFramework.dll)

'Declaration
Public Sub New ( _
	nameOrConnectionString As String, _
	model As DbCompiledModel _
)
'Usage
Dim nameOrConnectionString As String 
Dim model As DbCompiledModel 

Dim instance As New DbContext(nameOrConnectionString, _
	model)

Parameters

nameOrConnectionString
Type: System.String

Either the database name or a connection string.

model
Type: System.Data.Entity.Infrastructure.DbCompiledModel

The model that will back this context.

Show:
© 2014 Microsoft