Skip to content
Ivaylo Kenov edited this page Aug 20, 2016 · 3 revisions

The expression parser uses an internal cache to improve the performance of the route resolving. The important for this package objects from the MVC framework are IActionDescriptorsCollectionProvider and the collection of ControllerActionDescriptor it provides. These are created at application start up and cached by the MVC framework afterwards for later usage. It is really highly unlikely for a developer to change these objects run-time, but if you do for some reason and see unexpected results from the link generation, you need to clear the expression parser's internal cache or reinitialize it so that it continues to function properly. Here is how it can be done:

// clears the internal cache
serviceProvider.GetService<IExpressionRouteHelper>().ClearActionCache();
Clone this wiki locally