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
Implements
Inherited Members
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 SourceHostingBuilder(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 SourceServiceCollection
Gets the service collection associated with the current builder.
Declaration
public IServiceCollection ServiceCollection { get; }
Property Value
Type | Description |
---|---|
Microsoft.Extensions.DependencyInjection.IServiceCollection |
ServiceRegistry
Gets the service registry associated with the current builder.
Declaration
public EnvironmentRegistry ServiceRegistry { get; }
Property Value
Type | Description |
---|---|
EnvironmentRegistry |