I've registered my FooBar type with ASP.NET's built-in container.
I need an instance in one of my action methods. If I needed it in all of the controller's actions, then I'd inject it into the constructor. But I only need it in one action method.
So in the action method, I assume I could do this (untested):
var service = HttpContext.RequestServices.GetService(typeof(FooService)) as FooService;
But the docs say that is is a bad idea. I agree.
So what are my options?