IViewLocationExpander Interface


Specifies the contracts for a view location expander that is used by RazorViewEngine instances to determine search paths for a view.

public interface class IViewLocationExpander
public interface IViewLocationExpander
type IViewLocationExpander = interface
Public Interface IViewLocationExpander


Individual IViewLocationExpanders are invoked in two steps: (1) PopulateValues(ViewLocationExpanderContext) is invoked and each expander adds values that it would later consume as part of ExpandViewLocations(ViewLocationExpanderContext, IEnumerable<String>). The populated values are used to determine a cache key - if all values are identical to the last time PopulateValues(ViewLocationExpanderContext) was invoked, the cached result is used as the view location. (2) If no result was found in the cache or if a view was not found at the cached location, ExpandViewLocations(ViewLocationExpanderContext, IEnumerable<String>) is invoked to determine all potential paths for a view.


ExpandViewLocations(ViewLocationExpanderContext, IEnumerable<String>)

Invoked by a RazorViewEngine to determine potential locations for a view.


Invoked by a RazorViewEngine to determine the values that would be consumed by this instance of IViewLocationExpander. The calculated values are used to determine if the view location has changed since the last time it was located.

Applies to