MvcRazorHost Class

Namespace
Microsoft.AspNetCore.Mvc.Razor
Assemblies
  • Microsoft.AspNetCore.Mvc.Razor.Host

Syntax

public class MvcRazorHost : RazorEngineHost, IMvcRazorHost
class Microsoft.AspNetCore.Mvc.Razor.MvcRazorHost

Constructors

MvcRazorHost(Microsoft.AspNetCore.Mvc.Razor.Directives.IChunkTreeCache, Microsoft.AspNetCore.Razor.Compilation.TagHelpers.ITagHelperDescriptorResolver)

Initializes a new instance of Microsoft.AspNetCore.Mvc.Razor.MvcRazorHost using the specified <em>chunkTreeCache</em>.

Arguments:
public MvcRazorHost(IChunkTreeCache chunkTreeCache, ITagHelperDescriptorResolver resolver)
MvcRazorHost(System.String)

Initializes a new instance of Microsoft.AspNetCore.Mvc.Razor.MvcRazorHost with the specified <em>root</em>.

Arguments:root (System.String) – The path to the application base.
public MvcRazorHost(string root)

Properties

Microsoft.AspNetCore.Mvc.Razor.MvcRazorHost.CreateModelExpressionMethod

Gets the method name used to create model expressions.

Return type:System.String
public virtual string CreateModelExpressionMethod { get; }
Microsoft.AspNetCore.Mvc.Razor.MvcRazorHost.DefaultInheritedChunks

Gets the list of chunks that are injected by default by this host.

Return type:System.Collections.Generic.IReadOnlyList<Microsoft.AspNetCore.Razor.Chunks.Chunk>
public virtual IReadOnlyList<Chunk> DefaultInheritedChunks { get; }
Microsoft.AspNetCore.Mvc.Razor.MvcRazorHost.DefaultModel

Gets the model type used by default when no model is specified.

Return type:System.String
public virtual string DefaultModel { get; }
Microsoft.AspNetCore.Mvc.Razor.MvcRazorHost.InjectAttribute

Gets or sets the name attribute that is used to decorate properties that are injected and need to be activated.

Return type:System.String
public virtual string InjectAttribute { get; }
Microsoft.AspNetCore.Mvc.Razor.MvcRazorHost.ModelExpressionProvider

Gets the property name for <code>IModelExpressionProvider</code>.

Return type:System.String
public virtual string ModelExpressionProvider { get; }
Microsoft.AspNetCore.Mvc.Razor.MvcRazorHost.ModelExpressionType

Gets the type name used to represent Microsoft.AspNetCore.Razor.TagHelpers.ITagHelper model expression properties.

Return type:System.String
public virtual string ModelExpressionType { get; }
Microsoft.AspNetCore.Mvc.Razor.MvcRazorHost.TagHelperDescriptorResolver
Return type:Microsoft.AspNetCore.Razor.Compilation.TagHelpers.ITagHelperDescriptorResolver
public override ITagHelperDescriptorResolver TagHelperDescriptorResolver { get; set; }
Microsoft.AspNetCore.Mvc.Razor.MvcRazorHost.ViewDataPropertyName

Gets the property name for <code>ViewDataDictionary</code>.

Return type:System.String
public virtual string ViewDataPropertyName { get; }

Methods

DecorateCodeGenerator(Microsoft.AspNetCore.Razor.CodeGenerators.CodeGenerator, Microsoft.AspNetCore.Razor.CodeGenerators.CodeGeneratorContext)
Return type:Microsoft.AspNetCore.Razor.CodeGenerators.CodeGenerator
public override CodeGenerator DecorateCodeGenerator(CodeGenerator incomingGenerator, CodeGeneratorContext context)
DecorateCodeParser(Microsoft.AspNetCore.Razor.Parser.ParserBase)
Return type:Microsoft.AspNetCore.Razor.Parser.ParserBase
public override ParserBase DecorateCodeParser(ParserBase incomingCodeParser)
DecorateRazorParser(Microsoft.AspNetCore.Razor.Parser.RazorParser, System.String)
Return type:Microsoft.AspNetCore.Razor.Parser.RazorParser
public override RazorParser DecorateRazorParser(RazorParser razorParser, string sourceFileName)
GenerateCode(System.String, System.IO.Stream)
Return type:Microsoft.AspNetCore.Razor.CodeGenerators.GeneratorResults
public GeneratorResults GenerateCode(string rootRelativePath, Stream inputStream)
GetInheritedChunkTreeResults(System.String)

Locates and parses _ViewImports.cshtml files applying to the given <em>sourceFileName</em> to create Microsoft.AspNetCore.Mvc.Razor.Directives.ChunkTreeResults.

Arguments:sourceFileName (System.String) – The path to a Razor file to locate _ViewImports.cshtml for.
Return type:System.Collections.Generic.IReadOnlyList<Microsoft.AspNetCore.Mvc.Razor.Directives.ChunkTreeResult>
Returns:Inherited Microsoft.AspNetCore.Mvc.Razor.Directives.ChunkTreeResults.
public IReadOnlyList<ChunkTreeResult> GetInheritedChunkTreeResults(string sourceFileName)