I've hooked up Ninject (correctly) to bind NLog. Here is my RegisterService method in my NinjectMVC3.cs
kernel.Bind<ILogger>().To<NLogger>();
I'm trying to port over to PetaPoco and have created a base controller here:
public class BaseController : Controller
{
protected PetaPoco.Database _database;
protected ILogger _logger;
protected MemberRepository _members;
public BaseController(ILogger logger)
{
_database = new PetaPoco.Database("TalentSiteConnection");
_members = new MemberRepository(_database);
_logger = logger;
}
}
When I inherit my base controller like so:
public class TestController : BaseController
{
public ActionResult Index()
{
TestViewModel model = new TestViewModel();
model.Member = _members.Single<Member>(2579);
return View("Index", model);
}
}
and try to run a build I'm getting a
'BaseController' does not contain a constructor that takes 0 arguments
What am I doing wrong? I thought Ninject would resolve the dependency on the constructor?
.