The new data model wizard adds the connection string to your configuration file, and the code generation is configured to create a context using the parameterless constructor, which then calls the base constructor with the name "name = foo", so the connection string in the config file will be used.
If you want to explicitly pass the connection string to the constructor (instead of reading it from config), you can use the fact that the context is a partial class to add this constructor. You can also modify the T4 code generation template to modify the created constructor.
Arthur vickers
source share