Show / Hide Table of Contents

Class CSharpHostingBuilderExtensions

Extension methods related to the use of ZPT Python expressions.

Inheritance
System.Object
CSharpHostingBuilderExtensions
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: ZptSharp
Assembly: ZptSharp.CSharpExpressions.dll
Syntax
public static class CSharpHostingBuilderExtensions

Methods

| Improve this Doc View Source

AddZptCSharpExpressions(IBuildsHostingEnvironment, Action<IConfiguresCSharpExpressionGlobals>)

Adds service registrations to the builder in order to enable the use of ZPT "csharp" expressions.

Declaration
public static IBuildsHostingEnvironment AddZptCSharpExpressions(this IBuildsHostingEnvironment builder, Action<IConfiguresCSharpExpressionGlobals> configAction = null)
Parameters
Type Name Description
IBuildsHostingEnvironment builder

The self-hosting builder.

System.Action<IConfiguresCSharpExpressionGlobals> configAction

An optional action permitting some global configuration of the C# expression evaluation.

Returns
Type Description
IBuildsHostingEnvironment

The self-hosting builder instance, after setting it up.

Remarks

As well as the primary "csharp" expression, there are three other expression types which are activated by this method. In total, the expression evaluators registered by this type are:

  • AssemblyReferenceEvaluator using the prefix assemblyref
  • UsingNamespaceEvaluator using the prefix using
  • VariableTypeEvaluator using the prefix type
  • CSharpExpressionEvaluator using the prefix csharp

Additionally, an optional configuration action/callback may be supplied. If used, the IConfiguresCSharpExpressionGlobals may be used to add-to the lists of assembly references and 'using' namespaces which are available to all "csharp" expressions, whether they have been added explicitly via "assemblyref" or "using" expressions or not.

  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX