I would like to pass a connection string to the constructor of DbContext. The way to do this has been answered here: Pass connection string to code-first DbContext
(code if you don't like to click)
public MyContext(string connString)
: base(connString)
{
}
However, when I attempt to enable migrations I receive the error: "The target context '...' is not constructible. Add a default constructor or provide an implementation of IDbContextFactory."
Also, when I attempt to use EF PowerTools to generate an Entity Data Model is receive the error: "A constructible type deriving from DbContext could not be found in the selected file."
Is this a common problem? I have a fix, but it feels like a hack. Any one else have to deal with this before?