RazorEngine


CSharpRoslynCompilerService

Defined in RazorEngine.Roslyn.dll.

A concrete ICompilerService implementation for C# by using the Roslyn compiler.

Constructors

ConstructorDescription
new(strictMode, markupParserFactory)
Signature: (strictMode:bool * markupParserFactory:Func<ParserBase>) -> unit

Creates a new CSharpRoslynCompilerService instance.

Instance members

Instance memberDescription
BuildTypeName(templateType, modelType)
Signature: (templateType:Type * modelType:Type) -> string
Modifiers: abstract

Build a C# typename.

Returns:

CreateOptions(context)
Signature: context:TypeContext -> CompilationOptions
Modifiers: abstract

Creates a CSharpCompilationOptions instance.

Returns:

GetEmptyCompilation(assemblyName)
Signature: assemblyName:string -> Compilation
Modifiers: abstract

Creates a CSharpCompilation instance

Returns:

GetSyntaxTree(...)
Signature: (sourceCode:string * sourceCodePath:string) -> SyntaxTree
Modifiers: abstract

Creates a CSharpSyntaxTree instance.

Returns:

IncludeReferences()
Signature: unit -> IEnumerable<CompilerReference>
Modifiers: abstract

Returns a set of assemblies that must be referenced by the compiled template.

Returns: The set of assemblies.

InspectSource(results, context)
Signature: (results:GeneratorResults * context:TypeContext) -> string
Modifiers: abstract

Inspects the GeneratorResults and returns the source code.

Returns:

SourceFileExtension
Signature: string
Modifiers: abstract

Returns "cs".

Fork me on GitHub