Cleaning Up The Program.cs File In .NET 6 Now That Startup.cs is Gone

IAmTimCorey
IAmTimCorey
39.2 هزار بار بازدید - 2 سال پیش - With ASP.NET Core in .NET
With ASP.NET Core in .NET 6, we lost the Startup.cs file. All of that functionality was moved into the Program.cs file, and while it was consolidated, the Program file can get quite large. In this video, we will look at techniques to keep the Program.cs file clean and focused. We will use a Minimal API since that project type is the worst offender here, but these techniques will apply to all ASP.NET Core project types, as well as to other projects in the C# ecosystem.

Full Training Courses: https://IAmTimCorey.com
Source Code: https://leadmagnets.app/?Resource=Pro...

Mailing List:  https://signup.iamtimcorey.com/

0:00 - Intro
1:18 - Getting Started: Creating ApiDemo(ASP.NET Core Web API)
3:12 - Program.cs
4:32 - Services(Dependency Injection)
5:01 - Swagger
5:58 - Minimal APIs actions(Endpoints)
8:15 - Refactor Services(Dependency Injection)
14:39 - Refactor Swagger
17:14 - Refactor Minimal APIs(Endpoints)
22:14 - Cleaning up MS Sample code
22:54 - Recap
2 سال پیش در تاریخ 1401/06/07 منتشر شده است.
39,256 بـار بازدید شده
... بیشتر