ChunkInheritanceUtility Class

Summary

A utility type for supporting inheritance of directives into a page from applicable <c>_ViewImports</c> pages.

Syntax

public class ChunkInheritanceUtility

GitHub

View on GitHub

class Microsoft.AspNet.Mvc.Razor.Directives.ChunkInheritanceUtility

Constructors

ChunkInheritanceUtility(Microsoft.AspNet.Mvc.Razor.MvcRazorHost, Microsoft.AspNet.Mvc.Razor.Directives.IChunkTreeCache, System.Collections.Generic.IReadOnlyList<Chunk>)

Initializes a new instance of [Microsoft.AspNet.Mvc.Razor.Directives.ChunkInheritanceUtility](Microsoft.AspNet.Mvc.Razor.Directives.ChunkInheritanceUtility.yml).

Arguments:
  • razorHost (Microsoft.AspNet.Mvc.Razor.MvcRazorHost) – The [Microsoft.AspNet.Mvc.Razor.MvcRazorHost](Microsoft.AspNet.Mvc.Razor.MvcRazorHost.yml) used to parse <c>_ViewImports</c> pages.
  • chunkTreeCache (Microsoft.AspNet.Mvc.Razor.Directives.IChunkTreeCache) – [Microsoft.AspNet.Mvc.Razor.Directives.IChunkTreeCache](Microsoft.AspNet.Mvc.Razor.Directives.IChunkTreeCache.yml) that caches @!:ChunkTree- instances.
  • defaultInheritedChunks (System.Collections.Generic.IReadOnlyList{Chunk}) – Sequence of @!:Chunk-s inherited by default.
public ChunkInheritanceUtility(MvcRazorHost razorHost, IChunkTreeCache chunkTreeCache, IReadOnlyList<Chunk> defaultInheritedChunks)

Methods

GetInheritedChunkTrees(System.String)

Gets an ordered [System.Collections.Generic.IReadOnlyList`1]() of parsed @!:ChunkTree- for each

<c>_ViewImports</c> that is applicable to the page located at <paramref name=”pagePath” />. The list is ordered so that the @!:ChunkTree- for the <c>_ViewImports</c> closest to the

<paramref name=”pagePath” /> in the file system appears first.

Arguments:
  • pagePath (System.String) – The path of the page to locate inherited chunks for.
Return type:

System.Collections.Generic.IReadOnlyList{ChunkTree}

Returns:

A [System.Collections.Generic.IReadOnlyList`1]() of parsed <c>_ViewImports</c>@!:ChunkTree-s.

public virtual IReadOnlyList<ChunkTree> GetInheritedChunkTrees(string pagePath)
MergeInheritedChunkTrees(ChunkTree, System.Collections.Generic.IReadOnlyList<ChunkTree>, System.String)

Merges @!:Chunk- inherited by default and @!:ChunkTree- instances produced by parsing

<c>_ViewImports</c> files into the specified <paramref name=”chunkTree” />.

Arguments:
  • chunkTree (ChunkTree) – The @!:ChunkTree- to merge in to.
  • inheritedChunkTrees (System.Collections.Generic.IReadOnlyList{ChunkTree}) – [System.Collections.Generic.IReadOnlyList`1]() inherited from <c>_ViewImports</c> files.
  • defaultModel (System.String) – The list of chunks to merge.
public void MergeInheritedChunkTrees(ChunkTree chunkTree, IReadOnlyList<ChunkTree> inheritedChunkTrees, string defaultModel)