IMvcRazorHost Interface

Summary

Specifies the contracts for a Razor host that parses Razor files and generates C# code.

Syntax

public interface IMvcRazorHost

GitHub

View on GitHub

interface Microsoft.AspNet.Mvc.Razor.IMvcRazorHost

Methods

GenerateCode(System.String, System.IO.Stream)

Parses and generates the contents of a Razor file represented by <paramref name=”inputStream” />.

Arguments:
  • rootRelativePath (System.String) – The path of the relative to the root of the application. Used to generate line pragmas and calculate the class name of the generated type.
  • inputStream (System.IO.Stream) – A [System.IO.Stream]() that represents the Razor contents.
Return type:

GeneratorResults

Returns:

A @!:GeneratorResults- instance that represents the results of code generation.

GeneratorResults GenerateCode(string rootRelativePath, Stream inputStream)

Properties

DefaultNamespace()

Represent the namespace the main entry class in the view.

Return type:System.String
string DefaultNamespace { get; }
MainClassNamePrefix()

Represent the prefix off the main entry class in the view.

Return type:System.String
string MainClassNamePrefix { get; }