Class CSharpHostingBuilderExtensions
Extension methods related to the use of ZPT Python expressions.
Inheritance
Inherited Members
Namespace: ZptSharp
Assembly: ZptSharp.CSharpExpressions.dll
Syntax
public static class CSharpHostingBuilderExtensions
Methods
| Improve this Doc View SourceAddZptCSharpExpressions(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.