.NET 6 Minimal API Full Build
Вставка
- Опубліковано 5 жов 2024
- In this step by step video we perform a full step by step build of a .NET 6 minimal API. We also contrast and compare it with a MVC API to further understand the differences and similarities between them.
Level: Beginner
🌐 Links 🌐
💾 GitHub Repository: github.com/bin...
🤩 Patreon Site (Exclusive Member Benefits!): / binarythistle
🎓 My other courses: lesjackson.net/
📕 My Book: link.springer.....
🌲 Linktree: linktr.ee/bina...
🔗 Minimal API Tutorial: docs.microsoft...
🔗 Custom Model Binding: docs.microsoft...
🔗 MSSQL Download: docs.microsoft...
⏲️ Time Codes ⏲️
PART 1 - INTRODUCTION
01:05 Welcome
02:48: Video Overview
07:42 MVC Refresher
10:36 ASP.NET API Architecture
15:38 What’s “missing” from Minimal APIs?
PART 2 - CODE BUILD
19:47 Scaffold Minimal
26:29 Package Dependencies
28:25 Initialising User Secrets
30:26 Setting up SQL Server with Docker
39:30 Model & Dto Creation
51:09 DB Context
54:40 Connection String
1:02:36 Migrating
1:07:44 Repository
1:23:37 Automapper
1:29:52 Quick Controller Review
1:34:08 1st minimal endpoint
1:42:37 2nd Endpoint - get a single resource
1:47:56 3rd Endpoint - create a resource
1:58:03 4th Endpoint - update a resource
2:03:21 5th Endpoint -delete a resource
PART 3 - MVC COMPARISON
2:06:52 Review of MVC Features
2:08:21 Filtering & the Filter Pipeline
2:14:15 Custom Model Binding
2:20:39 Model Validation
2:24:21 Patch Endpoint
2:28:56 Wrap up and conclusions
2:31:16 Credits
PART 4 - WRAP & CREDITS
10:24 - ASP.NE CORE MVC API
2:24:31 - Supporter Credits
Absolutely marvelous. Just finished, thank you for the content all the way from Brazil.
You have a wonderful way of explaining concepts. I have watched many, many other videos and none were nearly as clear as this one. Thank you so much!
Awesome work as always, Most Underrated channel in whole Programming Community.
It has been two years since, the video has been provided. The relevancy of the tutorial is still strong. I only wish to add that support for filter has now been added to minimal api.
Hi Les, I have followed your course about the entity framework and it was awesome. And I have a future project with mini APi. Thanks for sharing your knowledge.
Can you please share me link for entity framework course by Les 🙏
Hi @@VinuP2023, great course.
Less demonstrate in 10 lessons the different ways for the CRUDPros:
- The different stets about Migration and the more important: rollback
- Minimal project: Task Manager.
- Win Form. I don't know this type of programmation.
Great courses.
ua-cam.com/video/4_U7TQVGkgQ/v-deo.html
I swear the best in the business, God bless you ! , from Germany
Thanks an excellent summary. As a newbie to ASPNet and C# I find the whole MVC architecture very complex. The minimal approach, especially if you separate functional areas into different class files for clarity/maintenance, makes more sense and closer to the more 'traditional' coding I'm used to.
Have received the notification and am already excited to watch this video. So not look yet, but I know it will again be a decent one. Thank you Les
The way you explain things is amazing. Thank you for the tutorial
Really impressive neat and clean work. Thank you for the content all the way from Pakistan.
Excellent content. Thanks so much. Love the little sign, perfectly positioned over your left shoulder, that's a very nice touch but I think the light for your face is a little bright.
Les is the best. Thank you Les you've taught me so much.
Fantastic tutorial! An incredibly helpful and thorough lesson. If you're looking to acquire the skills to construct a backend API, this is an excellent resource. Many thanks, Les! Your efforts are truly appreciated.
And Kudos to this video! It is a really good help to understand minimal APIs.
Thanks for this video! It's time well spend to get a good overview about Minimal API!
Amigo, no sabes cuanto agradezco tus videos, muy pero muy buenos!! Saludos desde chile
Thank you for this meticulous walkthrough, just what I needed
If you're making an API, the JSON absolutely is the view, it's the user interaction with the API - how they see it. If you're designing an API for others to consume, it's important to think of it that way, to ensure you keep it as clean and easy to use as possible.
Another great tutorial. Thanks Les for your contribution.
Many thanks to you for this. Full of content as usual
This is the kind of channel I'm looking for🤗🤘
Damn, I was just thinking when you will. Make a new video and here it is. Thank you Las, as always. You do a great job and may God bless your kind hearth
Been to Melbourne back in 2007. An awesome city. Greetings of peace from Astana 👋👋
Les, thank you very much!
Video was really helpful.
Best wishes from Ukraine!
I see Les(s) I give like.
Hello LJackson. Tks a lot for the video!
I'm a new dev VS-C# guy 🧑🏻💻😄. I have 2 question about VS Minimal API:
1 - How usually do you run in production mode, the minimals api? as a windows service to run in brackground?
2 - Is it possible turn a VS minimal api as a Windows Service since a Visual Studio and use a Setup Windows Project to install this minimal api in the customers as a windows service?
Thank you for this very helpful demonstration.
Amazing communicator
Thanks Les. Enjoyed that.
Thank you Les, I learnt a lot
Thanks Les, you're also an expert teacher 👌
Les is really more ... thank you
I'm at half of the video so far so good. I have just switch to Postgres as I develop on Linux based machine ( Manjaro ) and migration gave me platform unsupported exception
Fantastic...Thank for the another great video Les!
Fantastic! Thank you Les!
Awesome content 👍... @les can you please tell me the complete trending roadmap for becoming a .net software engineer ..
Hey Les, thanks for the video. I would appreciate a video building a real app. You are an excellent teacher. But most of your videos are from a technology perspective whereas I feel a video showing how you'd approach a real world application from start to finish would be great. Maybe something like a real-estate listing platform? A social media site?
Many thanks for this valuable information! Best wishes! :)
Thanks Les for the informative video
Your content is super accessible and very useful, thank you for your hard work!
Had me at the intro music...a good beat to hype you up before you start practicing "Les is Mour"
Really a great tutorial. Thanks for this :)
I had a weird issue where the ef migration errored with a "primary key not defined" issue on Command despite the [Key] attribute being applied. In the end I removed the attribute as ef assumes something called "Id" is the key and that worked! Very strange, posted as I thought it might help anyone else who has the same problem. Note: your version on Git that has the attribute does work!
Thanks! I just got that error.
Thank you for video. It is really interesting as usual
Great Video Les 👍
That was awesome, great job
Hi man, thank you for sharing!
Thanks for the awesome introductory tutorial.. But I would appreciate more if the voice audio could more clean and loud.
Great content. Thanks Les.
Good stuff! Just a little nitpick on terminology - "model" in MVC implies domain model, and so includes all business logic, including persistence. What you call "model" is a data model, which is a part of domain model, but latter also includes all allowed operations, and basically is a model in the scientific sense - as a "simplified representation of a real world phenomenon".
Yeah, good stuff indeed! Oh, didn't know that! Do we use "model" as you mention as well as "data model" when we draw the architecture? Or is it kind of interchangeable if that makes sense?
@@chillydill4703 I perfer to call it a data model when implementing web API because that's what it really is. In the non-so-recent past it was common to place logic into a separate layer (conventionally called "business logic layer"). This is not that common nowadays as business logic is often placed into services or even repositories, so that entire web API project is essentially a domain model. I'm a big fan of using precise terminology when possible because it makes reading the code easier (and code is read much more often than it's written in most LOB applications), so I typically call data access-related stuff a data model (because that's what it really is if you think about it). But I also use IQueryable to build custom LINQ queries from within services (so my repositories tend to return IQueryable such that services can further specialize queries before they were actually sent out to DB), and as such it's not easy to cleanly separate DB layer from services either. But since that brings about many advantages (like projections which allow only retrieving columns you actually need instead of blanket-all columns, or dynamic LINQ queries instead of a million of repository methods like GetEntitilesWhichFullfilConditionsSetNumber42), I'm OK with such a "leaky" abstraction.
Great Presentation, put a beginner at ease. question - can we use User secret in production - is that information encrypted
Do you have a video for MVC? I'm keen to watch on that. Thanks!
Hi Les loving your work, Which part of Scotland are you from I'm rom Fife
@Les, I see you have videos around EF however they are quite old. May I ask you to create a video on EF Core 6.0? Thanks!
good video , however regarding repository. I know that you can swap out your db context and whatever. But frankly how often has that ever happened.
Nice video!, Does minimal API work in all cases? If not, in which cases does the Minimal API work and in which cases should it not be used? Thanks
your videos on dotnet graphQl helped me a lot. I have created a dotnet graphQL api, and an angular application that consumes this api....
I am currently trying to publish my graphQL api on iis serve on windows...
I'm trying to publish my graphQL api on iis serve on windows... Did you already talk about this subject? if yes you can give me the link, if not you can redirect me to a resource that can help me
Awesome video . Please bring in more videos related to Azure.
Which one is better to use Dapper or EF Core ? I have browse through many articles over internet but didn't get much clear idea over it. What are the different best scenario to use EF Core and Dapper ?
Love this!
Excellent!
i really wish for Angular video too :D
Had a trust issue running the ef update command. Added "TrustServerCertificate=True" to the end of my connection string in the appsettings for a quick fix
Thank you Les. This is fantastic. Just a quick thingy... is it just me or is the code blurry in the video itself?
Use higher resolution in video settings. Default 360 causing blurry video.
Is there a reason you use visual studio code instead of Visual studio 2022?
Also could you explain how newton Json would work with sub classes?
What is the use of orchestrator application?
Got an error with the sql connection string. Adding "Encrypt=False;" solved it for me.
Hi Les, I just purchasing a course on your site but getting issue on the payment related on both via Paypal and others.
Thank you about the great content
.Net6 minimal API endpoints look very similar to route handlers in node.js-express.
Thanks to Share..
What is the purpose of AppDBContext class?
If only there was a way to subscribe again.❤❤❤❤❤
I feel in order to skip every single simple Controller I have to add a lot of extra codes/files in order to achieve the same thing. e.g. validating data.
What's the point of using Minimal API now? Am I missing something?
Is it correct to say MVC API or just REST API?
Hi hope you're all good and fine . I'd like to ask you that could you teach us how to connect two distinct machine via one single ip address and could exchange the message btw them ? Please let me know from your end. Thanks
Uhhhh :( una semana antes que saliera está nueva versión me registre con mi credencial de estudiante para la licencia, puedo tener acceso a esta versión o ya valió? Jaja
Feels and looks more like a Node js with Express framework
Hi, great video. However, I had an issue with calling the docker-compose up -d command on terminal. I keep on getting phrases like " Running 0/640 Downloading [================ - sqlserver Pulling" line after line, and never stopping. Do you have any tips to fix this.
Docker executable has not been granted permission to access internet; hence it's not able to reach repository to pull the required images... You may like to run in elevated mode to see if gets bypassed...
start coding at 19:47
Ace content
Is it a coincidence that his name is also Les?😂
Currently stuck on the migration process and am receiving this error: Microsoft.Data.SqlClient.SqlException (0x80131904): Login failed for user 'pa55w0rd!'. Has anyone run into this issue/resolved the error?
Also, Les is more.
👍👍👍👍👍
i am here
Tim Corey's look alike .
👏✍👌👏
please use quiet keyboard when recording ...
Постарел Лес
ommm
I wonder why developers have such egos...they must only be validated by the computer skills because there is this GUI called package manager but they like to confuse newbies to make it look like they are skilled because they use terminal. also the nice and easy way to use sql server is by using sql server without the container....weird. I think the concentration should be teaching and typing as little as possible and showing the newbie the tools within VS like nuget package manager and not concentrate on terminal so they can learn more about creating this api than having to learn terminal. Its distracts and takes away from what the real goal is. It's the same reason VS should be used and not an advanced tool for compiled programs like Code.
I agree with this. If you have to say "oh I have a tutorial for this" like 10 times in a beginner tutorial video then something is wrong.
I mean I understand WHY things are done in the way you are used to, and using tools to make it "easier" can be useful, but it undermines teaching the understanding of what is actually happening.
Just a tip for anyone stuck getting the db to work. I had to add SA_USERNAME: "sa" to the docker-compose file before it would let me log in with the sa account.
Had to add: TrustServerCertificate=True; to the connection string in appsettings.json to add the database
At offset 43-46 mins Les show the csproj nullable enable [good], but then wimps out by making nullable string? datatype [BAD] which is horrible and does not represent actual usage. Better to write property assignment to satisfy the analyzer warning, e.g. string Name {get;set;}=default!; which may be ugly but explicitly specifies intent that the property is non-nullable (except by the actual property assignment itself!).
EFCore also respects that property is non-null even without any explicit [Required] attribute, any any code that combines [Required] and string? should be a red-flag code-smell to developers.
Final plea is that Les should adopt file-scoped namespaces to regain horizontal coding palette (handy when viewing on narrow mobile devices).
Hello LJackson. Tks a lot for the video!
I'm a new dev VS-C# guy 🧑🏻💻😄.
I have 2 question about VS Minimal API:
1 - How usually do you run in production mode, the minimals api? as a windows service to run in brackground?
2 - Is it possible turn a VS minimal api as a Windows Service since a Visual Studio and use a Setup Windows Project to install this minimal api in the customers as a windows service?
Many Thanks!
Fantastic!