Show / Hide Table of Contents

Class HostingBuilder

A builder type which is used to activate optional/elective parts of the ZptSharp functionality, as part of setting up a ZptSharp environment.

Inheritance
System.Object
HostingBuilder
Implements
IBuildsHostingEnvironment
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.Hosting
Assembly: ZptSharp.dll
Syntax
public class HostingBuilder : IBuildsHostingEnvironment
Remarks

This object facilitates addition of services, similarly to the way in which a Microsoft.Extensions.DependencyInjection.IServiceCollection is used. It is intended for usage via its extension methods, each one performing a set of related set-up. This hosting builder object is always consumed via its interface IBuildsHostingEnvironment. It may be created from one of three ways:

  • From the AddZptSharp(IServiceCollection) method
  • As a parameter to the constructor of an MVC View Engine
  • As a parameter to the GetHost(Action<IBuildsHostingEnvironment>) method

This object is used to set-up which parts of the ZptSharp functionality are activated, such as add-on packages like document providers and expression evaluators. Activating each piece of functionality is performed via an extension method to the IBuildsHostingEnvironment interface. The absolute minimum required for a working ZptSharp environment is at least one activated document provider & at least one expression evaluator. A typical application might set that up as follows:

builder
    .AddStandardZptExpressions()
    .AddHapZptDocuments();

You are encouraged to read through the avaialble extension methods to discover what is available.

Constructors

| Improve this Doc View Source

HostingBuilder(IServiceCollection)

Initializes a new instance of HostingBuilder.

Declaration
public HostingBuilder(IServiceCollection serviceCollection)
Parameters
Type Name Description
Microsoft.Extensions.DependencyInjection.IServiceCollection serviceCollection

The service collection used to build this environment.

Properties

| Improve this Doc View Source

ServiceCollection

Gets the service collection associated with the current builder.

Declaration
public IServiceCollection ServiceCollection { get; }
Property Value
Type Description
Microsoft.Extensions.DependencyInjection.IServiceCollection
| Improve this Doc View Source

ServiceRegistry

Gets the service registry associated with the current builder.

Declaration
public EnvironmentRegistry ServiceRegistry { get; }
Property Value
Type Description
EnvironmentRegistry

Implements

IBuildsHostingEnvironment

Extension Methods

XmlHostingBuilderExtensions.AddXmlZptDocuments(IBuildsHostingEnvironment)
ZptSharpHostingBuilderExtensions.AddStandardZptExpressions(IBuildsHostingEnvironment)
ZptSharpHostingBuilderExtensions.AddZptPathExpressions(IBuildsHostingEnvironment)
ZptSharpHostingBuilderExtensions.AddZptStringExpressions(IBuildsHostingEnvironment)
ZptSharpHostingBuilderExtensions.AddZptNotExpressions(IBuildsHostingEnvironment)
ZptSharpHostingBuilderExtensions.AddZptPipeExpressions(IBuildsHostingEnvironment)
ZptSharpHostingBuilderExtensions.AddZptStructureExpressions(IBuildsHostingEnvironment)
AngleSharpHostingBuilderExtensions.AddAngleSharpZptDocuments(IBuildsHostingEnvironment)
CSharpHostingBuilderExtensions.AddZptCSharpExpressions(IBuildsHostingEnvironment, Action<IConfiguresCSharpExpressionGlobals>)
PythonHostingBuilderExtensions.AddZptPythonExpressions(IBuildsHostingEnvironment)
HapHostingBuilderExtensions.AddHapZptDocuments(IBuildsHostingEnvironment)
  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX