.NET 6: New features in .NET 6 (includes Minimal APIs)

preview_player
Показать описание
.NET 6 is here, and we try out four new features (like Minimal APIs) that you can use with your C# application.

We use an ASP.NET Core 6 Web API using Visual Studio 2022, and these features are amongst a number of updates that have been applied to the latest version of .NET.

The new features we cover are:

● Console template
The console template is one of the biggest .NET 6 changes. The ability to remove the namespace, class and Main method removes a lot of boiler-plate code making it easier to read.

● Merge Program and Startup
Continuing with the theme of making code easier to read, we look at how we can move the Startup class and put the configuration into the Program class.

● Minimal APIs
Minimal APIs are great if you have a very small API. We show you how you can bypass the MVC route, and put your API routes in the Program class.

● DateOnly and TimeOnly
At long last, .NET 6 allows you to use the DateOnly struct if you just want a date, and the TimeOnly struct if you just want the time.

💻 Download the code example for this demo 💻

📖 Learn .NET and C# with our online courses 📖

► Chapters
0:00 .NET 6 is close to completion
0:44 Console template
2:31 Merge Program and Startup
5:39 Minimal APIs
10:38 DateOnly and TimeOnly
14:16 How to use .NET 6

#dotnet #dotnet6 #aspnetcore
Рекомендации по теме
Комментарии
Автор

Glad to see I'm not the only one who forgets about the swagger "Try it out" button pretty much every time!

chrismingay
Автор

Another clear and concise video. A small request: please close all irrelevant windows in the IDE to maximize (in this case the Package Manager console), to maximize the overview of the source code.

andersborum
Автор

Nice small changes. Asp.Net Core needed these

bitzartdev
Автор

How did you get rid of the namespace, class, and method declarations from Program.cs at 1:33?

jesslilly
Автор

What about having an external project with extensions for the AppBuillder?

nove
Автор

Why not call DateOnly just Date and TimeOnly just Time?

bitzartdev