0

I use Ninject as a dependency injector for my ASP.Net MVC application.

However, MVCGridConfig is a static class.

How can I inject my ICoursesService in the MVCGridConfig class in order to retrieve the necessary data for the table?

Thank you very much!

MiBuena
  • 451
  • 3
  • 22
  • Yes, this was the correct things to do. if you want to you can post it as an answer so that I can choose it. – MiBuena Jul 06 '17 at 07:09

1 Answers1

0

I doubt you'll be able to inject into a static class, but you could pull it using

var svc = DependencyResolver.Current.GetService<ICoursesService>();
Paul Abbott
  • 7,065
  • 3
  • 27
  • 45