Question
.Net 6 Console app: WebApplication.CreateBuilder vs Host.CreateDefaultBuilder
I'm looking into .NET 6, and wanted to build a simple console application, with some dependency injection.
From what i can read, a lot has been done to make the startup (now just program) file, more readable. What does confuse me a bit is, that all improvements seems to have been made to WebApplication.CreateBuilderpart used in API projects, and not the Host.CreateDefaultBuilder. As mentioned in this blog
Microsofts own docs, also only seems to mention WebApplication.
To me it seems like WebApplication is only for web projects, like an API, and i can't find anything that confirms og debunks that.
Is it okay to use WebApplication in a console application, or should i rely on Host, and keep the stacked lambda expressions ?