C# Entity Framework with ASP.NET MVC Project Setup Adding the Class Library Project

Jaime Jesus Guerra Torres
Jaime Jesus Guerra Torres
11,767 Points

To fix the app problem, i changed the ConnectionString from the Manager App.Config to the class library App.Config.

I switched the connection string code in the App.Config file in Console Project to the App.Config file in the Library project. This make EF to create a new Database [ComicBookShared.Data.Context]. Is this also a solution? or is not recommended.

Simon Coates
Simon Coates
28,661 Points

I did the same thing. I have an earlier version of the project on my computer and they seemed to share a database. I had wondered if changing the context key would mess up my other project. Plus i assumed controlling the database connection from outside the library project would be useful if multiple projects used the library. I don't know whether it's a good idea or not.

(comment might be too late to be of interest to you, but might be interesting for someone taking the course down the track)