Back to Practical Aspnetcore

WebApplicationBuilder - Set environment by code

projects/minimal-hosting/web-application-builder-change-environment/README.md

latest699 B
Original Source

WebApplicationBuilder - Set environment by code

In most cases using WebApplication isn't enough because you need to configure additional services to be used in your system. This is where WebApplicationBuilder comes. It allows you to configure services and other properties.

In this example we show how to set the environment of the application by using WebApplicationOptions.

You can read the implementation of WebApplication here and its sibling WebApplicationBuilder here