The simplest way to create an API is with .NET | Minimal APIs

preview_player
Показать описание

Hello everybody I'm Nick and in this video I wanna talk about the Minimal API development approach coming in .NET 6. Historically .NET's WebAPI has been quite the "heavy" framework to build a performant API on. .NET 6 changes all that and paves the way for a stream of new APIs that need minimal code to be operational without cutting corners on performance and scale.

Don't forget to comment, like and subscribe :)

Social Media:

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

You've successfully made me wanna touch building APIs. I have always been avoiding them and sticking to my area, which is building libraries and now code analyzers, but the simplicity of properly building a functional API appeals to me like it's never done before.

AlFasGD
Автор

I started watching your other series where you created the api in the old way, and I didn't really understand how it worked(coming from Django, java). It was the most professional and well structured series I've ever seen! Hope you make a more beginner friendly series explaining the C# and architecture used.

johnnyt.
Автор

Beautiful!!! This makes me so happy!! (Says the NodeJS Developer in me!!)

okbrown
Автор

Cool! Now I need to know even less stuff to do my job!

bennymountain
Автор

Thanks for the video, I think one of the good use cases for this feature would be creating a mock server or a test API, otherwise I still would choose the old approach for production.

peymannaji
Автор

Amazing! I think that this is a great entry point for somebody who just wants to try to write some basic api in dotnet

cethrivias
Автор

My mind is literally blown away. My biggest frustration with C# is how verbose it is compared to PHP, JavaScript, and Python, and the compiler on change, so annoying. This really makes me want to use now, so excited to play with it.

Lyokou
Автор

Hi Nick, Can you please do a comparative analysis on Memory<T> and T [ ] ?

saadbinsami
Автор

Is there any advantage to building APIs the older way, besides having more (possibly) organization?

TransparentWorld
Автор

can you do a series on architectural and design patterns for microservices stack

basitameen
Автор

At first I thought it would change dramatically how we structure a project, but on second thought, I think it won't change too much actually (at least for microservices): following your example, I would have a static class CustomersApi, with static methods GetAll, GetById, etc that will be passed to app.MapGet, etc. That way testability for the new "controller" is easy to do, and the rest of the code can be organised in the same way you are used to.

darianferrer
Автор

A helpful video, as always, but when I follow along, why does mine need using statements and yours does not? I am using a .NET 6 console app project type - I can't see any icons in any project type that match yours. What type of project are you using? And even when I do add the suggested using statement for Microsoft.Graph.Models, the same builder function is not available. Any help/clarity would be much appreciated. Thanks, Steve

StephenBeale
Автор

Excellent, now I can simplify all my 'Hello World' APIs.

jakebradminster
Автор

Nick or anyone else correct me if I'm wrong or agree with me.
I would see how this is useful for a prototype or very simple application. Introducing this new way of writing APIs in an ENTERPRISE setting comes with a couple of drawbacks.
1. Your developers have to learn new skills to do what they already knew how to do with the conventional way
2. You should build your prototypes as closely to production ready as pragmatically possible, the code should be as close to the existing architecture as possible
3. You lose testability, then again this is not intended for business logic applications only CRUD and manual testing on small endpoints is ok
4. You have limited extensibility because of a simplistic architecture
5. Security has to be simplistic you lose flexibility in this aspect

If you keep these things in mind you will have a great time with Minimal APIs.

morgadoapi
Автор

Nice.. Thank you for your demonstration!

rockymarquiss
Автор

Thank you Mom Microsoft ! We truly love you !
I will try some spikes with Soc

Mirko_G.
Автор

Nick please do something with monitors/timeout monitors ! Thank you!

romafedor
Автор

1. This was amazing
2. Seeing you use Visual Studio was quite jarring 😜

alexvanheerden
Автор

Cool, gonna wait till November, knowing my luck I would mess things up with preview versions etc!!

lardosian
Автор

Which usings and dlls i need?
I dont find the webapplication class.

sky_walker_