Created
October 29, 2014 14:22
-
-
Save scottlittlewood/55aa09a8967b84a77ced to your computer and use it in GitHub Desktop.
This file contains 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
public class HttpListenerHostWithConfiguration : HttpListenerHost | |
{ | |
private readonly IConfigurationSource _configuration; | |
public HttpListenerHostWithConfiguration(IConfigurationSource configuration) | |
{ | |
_configuration = configuration; | |
} | |
public override bool ConfigureRootDependencies(IDependencyResolver resolver) | |
{ | |
var result = base.ConfigureRootDependencies(resolver); | |
if (result && _configuration != null) | |
{ | |
resolver.AddDependencyInstance<IConfigurationSource>(_configuration); | |
} | |
return result; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment