This repository was archived by the owner on Dec 19, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 308
Added support for generic host based IWebHostBuilder #1580
Merged
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
b5bda81
Added support for generic host based IWebHostBuilder
davidfowl 41ea22f
Added support for UseStartup(assemblyName) and added a single test (s…
davidfowl a4e2f4b
Small tweaks to fix up some comments
davidfowl 1cd7fd0
Make IHostingStartup work and respect configuration.
davidfowl db201b7
Call HostStop after StopAsync
davidfowl a8cd745
Renamed the IApplicationLifetime implementation
davidfowl e473d8d
Cleanup the hosted service
davidfowl 9a4de96
Make default application throw when not configured.
davidfowl 59ce1de
Throw good error if no application delegate was specified
davidfowl 6a3e77b
Unify the tests for the GenericWebHostBuilder and WebHostBuilder
davidfowl 2260c52
Fix ordering issues with IHostingStartup
davidfowl cbc20bb
Added light up interfaces for IWebHostBuilders
davidfowl 2c8a724
Added tests for incompatible behavior in GenericWebHostBuilder
davidfowl 2de091e
Added copyright and added error message text
davidfowl fa82809
Remove things
davidfowl 111d693
Renamed ServiceProvider -> HostServiceProvider
davidfowl f23af6f
Seperate test and production code (#1586)
Tratcher e27fb57
Don't run startup filters if the application isn't configured
davidfowl 4581900
Use new extension method in sample
davidfowl File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
24 changes: 24 additions & 0 deletions
24
src/Microsoft.AspNetCore.Hosting/GenericHost/GenericWebHostApplicationLifetime.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// Copyright (c) .NET Foundation. All rights reserved. | ||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. | ||
|
||
using System.Threading; | ||
|
||
namespace Microsoft.AspNetCore.Hosting.Internal | ||
{ | ||
internal class GenericWebHostApplicationLifetime : IApplicationLifetime | ||
{ | ||
private readonly Microsoft.Extensions.Hosting.IApplicationLifetime _applicationLifetime; | ||
public GenericWebHostApplicationLifetime(Microsoft.Extensions.Hosting.IApplicationLifetime applicationLifetime) | ||
{ | ||
_applicationLifetime = applicationLifetime; | ||
} | ||
|
||
public CancellationToken ApplicationStarted => _applicationLifetime.ApplicationStarted; | ||
|
||
public CancellationToken ApplicationStopping => _applicationLifetime.ApplicationStopping; | ||
|
||
public CancellationToken ApplicationStopped => _applicationLifetime.ApplicationStopped; | ||
|
||
public void StopApplication() => _applicationLifetime.StopApplication(); | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You from a year ago is trolling you now 😆
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😆