Skip to content
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public abstract class BackgroundService : IHostedService, IDisposable
/// </summary>
/// <param name="stoppingToken">Triggered when <see cref="IHostedService.StopAsync(CancellationToken)"/> is called.</param>
/// <returns>A <see cref="Task"/> that represents the long running operations.</returns>
/// <remarks>See <see href="https://docs.microsoft.com/dotnet/core/extensions/workers">Worker Services in .NET</see> for implementation guidelines.</remarks>
protected abstract Task ExecuteAsync(CancellationToken stoppingToken);

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,13 @@ namespace Microsoft.Extensions.Hosting
public interface IHost : IDisposable
{
/// <summary>
/// The programs configured services.
/// Gets the services configured for the program (for example, using <see cref="M:HostBuilder.ConfigureServices(Action&lt;HostBuilderContext,IServiceCollection&gt;)" />).
/// </summary>
IServiceProvider Services { get; }

/// <summary>
/// Start the program.
/// Starts the <see cref="IHostedService" /> objects configured for the program.
/// The application will run until interrupted or until <see cref="M:IHostApplicationLifetime.StopApplication()" /> is called.
/// </summary>
/// <param name="cancellationToken">Used to abort program start.</param>
/// <returns>A <see cref="Task"/> that will be completed when the <see cref="IHost"/> starts.</returns>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ public IHostBuilder ConfigureContainer<TContainerBuilder>(Action<HostBuilderCont
/// Run the given actions to initialize the host. This can only be called once.
/// </summary>
/// <returns>An initialized <see cref="IHost"/></returns>
/// <remarks>Adds basic services to the host such as application lifetime, host environment, and logging.</remarks>
public IHost Build()
{
if (_hostBuilt)
Expand Down