views:

87

answers:

1

Im trying to add Ninject to my app so that (maybe) I can try creating/running tests in it... so I need a little help setting this up

here's my controller

    public class CompaniesController : Controller
            {
                private ICompaniesServices _service;

                public CompaniesController()
                {
                    _service = new CompaniesServices(new ModelStateWrapper(this.ModelState));
                }

    ......

}

So, how can I change this to make it Ninject like??

also I need to do something like this in the Module I assume?

public override void Load()
        {
            Bind<ICompaniesServices>().To<CompaniesServices>();
        }
+1  A: 

This post looks like what your after: http://www.kevinrohrbaugh.com/blog/2009/8/7/using-ninject-2-with-aspnet-mvc.html

RogerNoble