Getting Route Data from within a driver

Topics: Writing modules
Nov 21, 2011 at 8:00 AM
Edited Nov 21, 2011 at 8:15 AM

In my driver I need to configure the shapes based on some criteria (basically inspecting the RouteData of the current request). How to do this better?

I think since the driver behaves like a controller, is should at the minimum contain a reference to the current HttpRequest.

Nov 21, 2011 at 11:49 AM

You can always access the current HttpContext by either looking at the WorkContext property from IOrchardServices or at GetContext() from IWorkContextAccessor. You can inject implementations of these interfaces from a constructor.