Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save scottlittlewood/55aa09a8967b84a77ced to your computer and use it in GitHub Desktop.
Save scottlittlewood/55aa09a8967b84a77ced to your computer and use it in GitHub Desktop.
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