LanguageViewLocationExpander Class

Definition

A IViewLocationExpander that adds the language as an extension prefix to view names. Language that is getting added as extension prefix comes from HttpContext.

public ref class LanguageViewLocationExpander : Microsoft::AspNetCore::Mvc::Razor::IViewLocationExpander
public class LanguageViewLocationExpander : Microsoft.AspNetCore.Mvc.Razor.IViewLocationExpander
type LanguageViewLocationExpander = class
    interface IViewLocationExpander
Public Class LanguageViewLocationExpander
Implements IViewLocationExpander
Inheritance
LanguageViewLocationExpander
Implements

Examples

For the default case with no areas, views are generated with the following patterns (assuming controller is "Home", action is "Index" and language is "en") Views/Home/en/Action Views/Home/Action Views/Shared/en/Action Views/Shared/Action

Constructors

LanguageViewLocationExpander()

Instantiates a new LanguageViewLocationExpander instance.

LanguageViewLocationExpander(LanguageViewLocationExpanderFormat)

Instantiates a new LanguageViewLocationExpander instance.

Methods

ExpandViewLocations(ViewLocationExpanderContext, IEnumerable<String>)

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

PopulateValues(ViewLocationExpanderContext)

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