MVCGrid.Net How can I inject a service in the MVCGridConfig class using Ninject?

120 Views Asked by At

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!

1

There are 1 best solutions below

0
On BEST ANSWER

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

var svc = DependencyResolver.Current.GetService<ICoursesService>();