changes to styling
parent
7f597b75a3
commit
4944e92e74
|
@ -98,19 +98,19 @@ The adoption of this new 2.0 pattern is highly recommended and is required for p
|
||||||
```
|
```
|
||||||
Unable to create an object of type '<Context>'. Add an implementation of 'IDesignTimeDbContextFactory<Context>' to the project, or see https://go.microsoft.com/fwlink/?linkid=851728 for additional patterns supported at design time.
|
Unable to create an object of type '<Context>'. Add an implementation of 'IDesignTimeDbContextFactory<Context>' to the project, or see https://go.microsoft.com/fwlink/?linkid=851728 for additional patterns supported at design time.
|
||||||
```
|
```
|
||||||
## Adding Additional Configurations
|
## Adding additional configuration
|
||||||
|
|
||||||
In 2.0 projects, the boilerplate configuration code is done behind the scenes. By default, Environment Variables and Application Settings are loaded into startup so all that is required in *Startup.cs* is initializing `IConfiguration` with the injected instance. To add additional providers, or change the existing providers, utilize `ConfigureAppConfiguration` on `IWebHostBuilder` in *Program.cs*. The setup is similar to Core 1.x
|
In 2.0 projects, the boilerplate configuration code runs behind the scenes. By default, environment variables and application settings are loaded into startup so all that is required in *Startup.cs* is initializing `IConfiguration` with the injected instance. To add additional providers, or change the existing providers, utilize `ConfigureAppConfiguration` on `IWebHostBuilder` in *Program.cs*. The setup is similar to 1.x
|
||||||
|
|
||||||
````
|
```csharp
|
||||||
var host = new HostBuilder()
|
var host = new WebHostBuilder()
|
||||||
.ConfigureAppConfiguration((hostContext, config) =>
|
.ConfigureAppConfiguration((hostContext, config) =>
|
||||||
{
|
{
|
||||||
config.AddEnvironmentVariables();
|
config.AddEnvironmentVariables();
|
||||||
config.AddJsonFile("appsettings.json", optional: true);
|
config.AddJsonFile("appsettings.json", optional: true);
|
||||||
config.AddCommandLine(args);
|
config.AddCommandLine(args);
|
||||||
})
|
});
|
||||||
````
|
```
|
||||||
|
|
||||||
|
|
||||||
<a name="view-compilation"></a>
|
<a name="view-compilation"></a>
|
||||||
|
|
Loading…
Reference in New Issue