Skip to content

Instantly share code, notes, and snippets.

@herecydev
Created April 25, 2017 11:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save herecydev/d8fa3ddd7107549dbc2211fda9c2773e to your computer and use it in GitHub Desktop.
Save herecydev/d8fa3ddd7107549dbc2211fda9c2773e to your computer and use it in GitHub Desktop.
public class Startup
{
public IConfiguration Configuration { get; }
public Startup()
{
var builder = new ConfigurationBuilder()
.AddEnvironmentVariables();
Configuration = builder.Build();
}
public void ConfigureServices(IServiceCollection services)
{
services.Configure<MyPoco>(options =>
{
options.FooBar = new Uri(Configuration["Foo"]); <======= How do I get this from the configuration?
});
}
}
var builder = new WebHostBuilder()
.UseSetting("Foo", "Bar")
.UseStartup<Startup>();
_server = new TestServer(builder);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment