Inject Services in Partial Controllers

Hi,

How can I inject a Repository Class with Dependency Injection in a Partial Controller? Is this possible?

You can use runtime DI like this (in a method of the partial controller):

var myService = (IMyService)HttpContext.RequestServices.GetService(typeof(IMyService));

It worked @korchev. Thanks!