Last post Jun 03, 2019 08:00 AM by Nan Yu
May 13, 2019 01:41 AM|tuckermd|LINK
Whenever I try to access a certain statement in one of my controllers, it tries to read in my DbContext to find a database object and says it can't find my database context file. What could I be missing?
May 13, 2019 02:18 AM|tuckermd|LINK
Nevermind, I wasn't using dependency injection.
Jun 03, 2019 08:00 AM|Nan Yu|LINK
Hi tuckermd ,
>>Nevermind, I wasn't using dependency injection.
In .net core we usually register the context with dependency injection :
The name of the connection string is passed in to the context by calling a method on a `DbContextOptionsBuilder` object , and in appsettings.json file add a connection string :