Inject Entity Framework DbContext using Ninject in ASP.NET MVC5
问题 I have just landed in dependency injection world. I have the following custom DbContext- public partial class SkyTrackerContext: DbContext { public SkyTrackerContext(): base() { Database.SetInitializer(new SkyTrackerDBInitializer()); } } Would like inject SkyTrackerContext in this base controller- public abstract class BaseController : Controller { public BaseController() {} [Inject] public SkyTrackerContext MyDbContext { get; set; } } Sample usage- public class LoginController :