I am using ninject to inject my repositories. I would like to have a my base class to be inherited but I cant because it has a constructor.
Base Controller:
namespace Orcha.Web.Controllers
{
public class BaseController : Controller
{
public IRepository<string> db;
public BaseController(Repository<string> db){
this.db = db;
Debug.WriteLine("Repository True");
}
}
}
Controller with inherit: Error 'BaseController' does not contain a constructor that takes 0 arguments HomeController.cs
public class HomeController : BaseController
{
public ActionResult Index()
{
ViewBag.Message = "Welcome to ASP.NET MVC!";
return View();
}
public ActionResult About()
{
return View();
}
}