IViewLocationExpander 介面

定義

指定實例用來 RazorViewEngine 判斷檢視路徑之檢視位置展開器的合約。

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

備註

個別 IViewLocationExpander 會在兩個步驟中叫用:叫用 (1) PopulateValues(ViewLocationExpanderContext) ,而每個展開器都會新增稍後會取用的值作為 的一 ExpandViewLocations(ViewLocationExpanderContext, IEnumerable<String>) 部分。 填入的值是用來判斷快取索引鍵 - 如果所有值都與上次叫用的時間 PopulateValues(ViewLocationExpanderContext) 相同,則會使用快取的結果做為檢視位置。 (2) 如果在快取中找不到任何結果,或是在快取位置找不到檢視, ExpandViewLocations(ViewLocationExpanderContext, IEnumerable<String>) 則會叫用 來判斷檢視的所有可能路徑。

方法

ExpandViewLocations(ViewLocationExpanderContext, IEnumerable<String>)

由 叫 RazorViewEngine 用 以判斷檢視的潛在位置。

PopulateValues(ViewLocationExpanderContext)

由 叫 RazorViewEngine 用 ,以判斷這個 實例 IViewLocationExpander 會取用的值。 匯出值是用來判斷檢視位置自上次找到之後是否已變更。

適用於