Created
April 25, 2017 11:13
-
-
Save herecydev/d8fa3ddd7107549dbc2211fda9c2773e 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 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? | |
}); | |
} | |
} |
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
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