ViewHierarchyUtility Class

Summary

Contains methods to locate <c>_ViewStart.cshtml</c> and <c>_ViewImports.cshtml</c>

Syntax

public class ViewHierarchyUtility

GitHub

View on GitHub

class Microsoft.AspNet.Mvc.Razor.ViewHierarchyUtility

Methods

GetViewImportsLocations(System.String)

Gets the locations for <c>_ViewImports</c>s that are applicable to the specified path.

Arguments:
  • applicationRelativePath (System.String) – The application relative path of the file to locate <c>_ViewImports</c>s for.
Return type:

System.Collections.Generic.IEnumerable{System.String}

Returns:

A sequence of paths that represent potential <c>_ViewImports</c> locations.

public static IEnumerable<string> GetViewImportsLocations(string applicationRelativePath)
GetViewStartLocations(System.String)

Gets the view start locations that are applicable to the specified path.

Arguments:
  • applicationRelativePath (System.String) – The application relative path of the file to locate <c>_ViewStart</c>s for.
Return type:

System.Collections.Generic.IEnumerable{System.String}

Returns:

A sequence of paths that represent potential view start locations.

public static IEnumerable<string> GetViewStartLocations(string applicationRelativePath)