/
HostBuilderContext.cs
37 lines (31 loc) · 1.31 KB
/
HostBuilderContext.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System;
using System.Collections.Generic;
using Microsoft.Extensions.Configuration;
namespace Microsoft.Extensions.Hosting
{
/// <summary>
/// Context containing the common services on the <see cref="IHost" />. Some properties may be null until set by the <see cref="IHost" />.
/// </summary>
public class HostBuilderContext
{
public HostBuilderContext(IDictionary<object, object> properties)
{
ThrowHelper.ThrowIfNull(properties);
Properties = properties;
}
/// <summary>
/// The <see cref="IHostEnvironment" /> initialized by the <see cref="IHost" />.
/// </summary>
public IHostEnvironment HostingEnvironment { get; set; } = null!;
/// <summary>
/// The <see cref="IConfiguration" /> containing the merged configuration of the application and the <see cref="IHost" />.
/// </summary>
public IConfiguration Configuration { get; set; } = null!;
/// <summary>
/// A central location for sharing state between components during the host building process.
/// </summary>
public IDictionary<object, object> Properties { get; }
}
}