I am using EF6 in a class library (database first)
When I followed the wizard and added my tables I selected not to store the connections string in the app.config an
I had this issue as well and used the method from Daniel in the comments.
Alternatively, you can add it to the .tt file instead of creating another file and using 'partial' – Daniel K Dec 9 '16 at 19:16
Update *.Context.tt File
just replace the lines...
public <#=code.Escape(container)#>()
: base("name=<#=container.Name#>")
{
with the following...
public <#=code.Escape(container)#>()
: this("name=<#=container.Name#>")
{
}
public <#=code.Escape(container)#>(String nameOrConnectionString)
: base(nameOrConnectionString)
{
I hope this helps.