Export (0) Print
Expand All

Database.DefaultConnectionFactory Property

Entity Framework 5.0

The connection factory to use when creating a DbConnection from just a database name or a connection string.

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

public static IDbConnectionFactory DefaultConnectionFactory { get; set; }

Property Value

Type: System.Data.Entity.Infrastructure.IDbConnectionFactory
The connection factory to use.

This is used when just a database name or connection string is given to DbContext or when the no database name or connection is given to DbContext in which case the name of the context class is passed to this factory in order to generate a DbConnection. The default connection factory creates a connection to SQL Express on the local machine. However, this default may be changed by an application framework.

© 2015 Microsoft