Can you please tell me how to inject a dbContext using the default dependency injection in MVC 6? Do I just need to create an interface and add it in the Startup.cs as below?
services.AddTransient<IMyDb, MyDb>();
Yes, that should be enough. Then, as part of the controller parameters, add the interface and it will be injected:
class MyController
{
public MyController(IMyDb dbContext)
{
// ...
}
}