다음을 통해 공유


Database.DefaultConnectionFactory 속성

정의

주의

The default connection factory should be set in the config file or using the DbConfiguration class. (See http://go.microsoft.com/fwlink/?LinkId=260883)

데이터베이스 이름 또는 연결 문자열에서 를 DbConnection 만들 때 사용할 연결 팩터리입니다.

public static System.Data.Entity.Infrastructure.IDbConnectionFactory DefaultConnectionFactory { get; set; }
[System.Obsolete("The default connection factory should be set in the config file or using the DbConfiguration class. (See http://go.microsoft.com/fwlink/?LinkId=260883)")]
public static System.Data.Entity.Infrastructure.IDbConnectionFactory DefaultConnectionFactory { get; set; }
member this.DefaultConnectionFactory : System.Data.Entity.Infrastructure.IDbConnectionFactory with get, set
Public Shared Property DefaultConnectionFactory As IDbConnectionFactory

속성 값

특성

설명

데이터베이스 이름 또는 연결 문자열만 에 지정 DbContext 하거나 DbContext에 데이터베이스 이름 또는 연결이 지정되지 않은 경우 DbConnection을 생성하기 위해 컨텍스트 클래스의 이름이 이 팩터리에 전달되는 경우에 사용됩니다. 기본적으로 IDbConnectionFactory 사용할 instance appSettings의 "EntityFramework DefaultConnectionFactory" 항목에서 애플리케이션의 .config 파일에서 읽습니다. 구성 파일에 SqlConnectionFactory 항목이 없으면 가 사용됩니다. 코드에서 이 속성을 설정하면 구성 파일에 있는 모든 값이 항상 재정의됩니다.

적용 대상