A little late to the game here, but another option is:
public class NerdDinners : DbContext
{
public NerdDinners(string connString)
{
this.Database.Connection.ConnectionString = connString;
}
public DbSet<Dinner> Dinners { get; set; }
}
More Related Contents:
- MSSQL Error ‘The underlying provider failed on Open’
- Testing an Entity Framework database connection
- summing values of a column based on id [closed]
- ExecuteReader requires an open and available Connection. The connection’s current state is Connecting
- There is already an open DataReader associated with this Command which must be closed first
- ‘Contains()’ workaround using Linq to Entities?
- Entity Framework Stored Procedure Table Value Parameter
- Method cannot be translated into a store expression
- How can I automatically filter out soft deleted entities with Entity Framework?
- How to use a string to create a EF order by expression?
- Many-to-many mapping table
- Why is inserting entities in EF 4.1 so slow compared to ObjectContext?
- Entity Framework error: Cannot insert explicit value for identity column in table
- Dynamic MySQL database connection for Entity Framework 6
- How to disable cascade delete for link tables in EF code-first?
- Entity framework, problems updating related objects
- Dynamic table name in linq [duplicate]
- Join and Include in Entity Framework
- Entity Framework 6 transaction rollback
- Creating dynamic queries with entity framework
- EF5 Getting this error message: Model compatibility cannot be checked because the database does not contain model metadata
- Async PartialView causes “HttpServerUtility.Execute blocked…” exception
- Unit testing with EF Core and in memory database
- Entity Framework – how do I get the columns?
- Entity Framework Eager Load Not Returning Data, Lazy Load Does
- How to group by DateTime.Date in EntityFramework
- How to include() nested child entity in linq
- Oracle Entity Framework – Generate Entity From Tables in Different Schema
- Entity framework – get entity by name
- LINQ Query to Convert string to datetime