This project is read-only.

IHttpHandler dependency injection or Controller??

Topics: General, Troubleshooting
May 30, 2012 at 7:52 AM

I need to implement processing of *.less files, I cant use the dotless httpHandler as I need to change variables dynamically.

There are 2 options...

- I can create my own HttpHandler, only thing is I have no idea how to inject dependencies?? constructor is not possible. Is there a global handle I to the Container I can get hold of??

- I can use a controller action instead, how would I set the route to catch all ".less" files site wide or at least theme?? I've tried

Route = new Route(
                        new RouteValueDictionary {
                            {"area", "Orchard.Custom"},
                            {"controller", "LessCss"},
                            {"action", "Index"}

but I cant pick up routes like