Many people use EF's default link factory: System.Data.Entity.Infrastructure.LocalDbConnectionFactory
Then I didn't get used to it, and then I studied it, as follows
Then there is
Public System.Data.Common.DbConnection createconnection (string nameorconnectionstring)
Members of the System.Data.Entity.Infrastructure.LocalDbConnectionFactory
Summary:
Creates a connection for SQL Server LocalDb based on the given database name or connection string. If the given string contains a "=" character, it is treated as a full connection string, otherwise it is treated as a database name only.
Parameters:
Nameorconnectionstring: Database name or connection string.
return value:
The initialized DbConnection.
This is also why you can use the "name= database link name" meaning.
Many people are basically using the model Frist and DB Frist when they name the entity DbContext name
Followed by
Member of Sqlconnectionfactory BaseConnectionString
public string BaseConnectionString {get;}
Members of the System.Data.Entity.Infrastructure.SqlConnectionFactory
Summary:
The connection string to use for the option of a database other than "initial directory". When you call CreateConnection, the initial directory is preset based on the database name before this string. The default value is "Data source=.\sqlexpress; Integrated security=true; Multipleactiveresultsets=true ".
return value:
The connection string.
Member of the Localdbconnectionfactory baseconnectionstring
public string BaseConnectionString {get;}
Members of the System.Data.Entity.Infrastructure.LocalDbConnectionFactory
Summary:
Connection string for database options other than initial directory, data source, and AttachDbFileName. When CreateConnection is called, "Initial directory" and "AttachDbFileName" are added based on the database name before this string. The data source is set based on the localdbversion parameter. The default value is "Integrated security=true; Multipleactiveresultsets=true; ".
The default values for both are not the same.
I used the EF4.4 version, found that the link factory has three,sqlconnectionfactory,localdbconnectionfactory,sqlceconnectionFactory. The last one is for small database sqlce,access and so on.
A preliminary study on the links in EntityFramework