Using connection strings

Passing the database name to the context constructor is simple if that’s all you need to do, but you may want (or need) more control than that. Remember that Entity Framework is part of ADO.NET, and when you’re working the Code First, you can use a ADO.NET standard connection string that specifies everything you need.

The exact structure of your connection string depends on the database server and of course the details depend on your development and deployment environment. I’m afraid that’s outside our scope. (And frankly, outside my area of expertise. There are a lot of database servers out there that I don’t have recent experience with.) But assuming you know what your connection string needs to look like, here are ...

Get Fluent Entity Framework now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.