class WebHostBuilder
cangjie
public class WebHostBuilder功能:提供构建 WebHost 实例的能力。
成员概览
| 成员 | 功能 |
|---|---|
| prop logging | 返回当前构建器使用的日志构建器。 |
| prop services | 返回当前构建器维护的服务集合。 |
| prop properties | 返回当前构建器维护的属性集合。 |
| prop environment | 返回当前构建器使用的 Web 主机环境。 |
| prop configuration | 返回当前构建器维护的配置管理器。 |
| func build() | 构建并返回 WebHost 实例。 |
| func configureServer((ServerBuilder) -> Unit) | 注册底层 HTTP 服务器的配置回调。 |
prop logging
cangjie
public prop logging: LoggingBuilder功能:返回当前构建器使用的日志构建器。
prop services
cangjie
public prop services: ServiceCollection功能:返回当前构建器维护的服务集合。
prop properties
cangjie
public prop properties: HashMap<String, Any>功能:返回当前构建器维护的属性集合。
类型:HashMap<String, Any>
prop environment
cangjie
public prop environment: IWebHostEnvironment功能:返回当前构建器使用的 Web 主机环境。
prop configuration
cangjie
public prop configuration: ConfigurationManager功能:返回当前构建器维护的配置管理器。
类型:ConfigurationManager
func build()
cangjie
public func build(): WebHost功能:构建并返回 WebHost 实例。
返回值:
- WebHost - 返回构建完成的 WebHost。
func configureServer((ServerBuilder) -> Unit)
cangjie
public func configureServer(configure: (ServerBuilder) -> Unit): This功能:注册底层 HTTP 服务器的配置回调。
参数:
- configure:
(ServerBuilder) -> Unit- 用于配置底层服务器构建器的回调。
返回值:
This- 返回当前构建器。