.NET Core 3.1 MVC REST API - Full Course
Вставка
- Опубліковано 21 кві 2020
- In this full course, we show you how to build a full REST API using .NET Core 3.1. We’ll employ MVC, REST, the Repository Pattern, Dependency Injection, Entity Framework, Data Transfer Objects, (DTOs), AutoMapper to provide 6 API endpoints that will allow you to Create, Read Update and Delete resources.
- Level: Beginner / Intermediate
- My Book: www.apress.com/gp/book/978148...
- My other courses: lesjackson.net/
- Patreon Site (Exclusive Member Benefits!): / binarythistle
- Code on GitHub: github.com/binarythistle/S03E...
---------------
INTRODUCTION
- 1:58 Course Overview
- 4:46 Application Architecture
- 7:30 API DEMO
CODING PART 1 - FIRST 2 API ENDPOINTS (GET / READ)
- 10:10 Project Setup
- 15:30 Create our Domain Model (Command)
- 18:30 Build Our Repository Interface
- 24:46 Implement our Repository Interface (Mock Reposiory)
- 30:46 Create our Controller (CommandsController)
- 35:59 Create 2x API Endpoints
- 48:35 Using Dependency Injection
CODING PART 2 - ENTITY FRAMEWORK & SQL SERVER
- 55:35 Architecture Checkpoint
- 56:58 Set Up SQL Server App Login
- 1:00:36 Entityframework Packages
- 1:03:48 Entityframework Toolset
- 1:05:00 Create our Database Context (CommanderContext)
- 1:08:33 Our Database Connecttion String
- 1:13:42 Register our DB Context in Startup
- 1:18:00 Create Migrations
- 1:21:40 Cancel Migrations & revist Command Model
- 1:23:10 Add Data Validations to Command Model
- 1:24:49 Create Migrations (Again!)
- 1:26:05 Run Migrations against Database
- 1:28:04 Add Data to Database
- 1:32:34 Revist Our Repository to use DB Context
CODING PART 3 - DATA TRANSFER OBJECTS & CREATE ENDPOINT
- 1:41:11 Architecture Checkpoint
- 1:42:01 Why Data Transfer Objects?
- 1:48:34 AutoMapper Package & Startup Registration
- 1:51:42 Create our first DTO
- 1:53:40 Creating a mapping Profile
- 1:57:07 Updating Our Action Results to use DTOs
CODING PART 4 - PUT, PATCH & DELETE API ENDPOINTS
- 2:04:14 Architecture Checkpoint
- 2:05:40 Updating our Repository for Creating Resources
- 2:12:14 Create a New DTO (for Creating)
- 2:15:47 Create 3rd API Endpoint to Create Resources
- 2:26:38 Use CreatedAtRoute to return 201 CreatedAtRoute
- 2:35:07 Add Annotations to DTO to avoid 500 Errors
- 2:44:10 Update Repository to Support Updates
- 2:47:09 Add a New DTO (for Updating)
- 2:50:08 Add 4th API Endpoint for Updating (PUT Request)
- 2:52:56 Update our AutoMapper Profile
- 3:00:58 Overview of PATCH
- 3:05:00 Install 2x packages to support PATCH
- 3:07:09 Update Startup
- 3:08:43 Update our AutoMapper Profile (Final Update)
- 3:09:39 Add 5th API Endpoint for Updating (PATCH Request)
- 3:19:45 Add 6th API Endpoint for Deleting (DELETE Request)
FINAL THOUGHTS & ACKNOWLEDGEMENTS
- 3:25:31 Final Thoughts
- 3:26:20 Patreon Supporter Credits - Наука та технологія
Can you share the code?
Hey mate, yes you can find the code on GitHub here: github.com/binarythistle/S03E02---.NET-Core-3.1-MVC-REST-API
Hi ate
@@binarythistle HOW IT CAN BE IMPLEMENTED USING ORACLE AS A DATABASE
@@lorenzoarce2760 you can do it with Oracle Data Provider for .NET Entity Framework Core
@@khoroshoigra8388 hi koya
This is seriously great. Keep these coming!
So glad I found Les and his outstanding tutorials. Thank you Les for taking the time and explaining things in such a simple but structured manner. Subscribed!!!
Never stop doing tutorials like this, you have helped me more than you think, and I'm sure a lot of people feel the same!
Thank you very much!
Hi Les, this is the most amazing video I saw on UA-cam related to the .NET Core API. You go through the topics smoothly and with mastery. It was my first access to your channel, and for sure I'll be a frequent visitor! Millions of thumbs up to you.
One of the best thorough tutorials on UA-cam. The best part is that the tutorial enforces best practices DI, mocking, data mapping and much more. Thank you for the awesome work....
It's 2:04AM. Just finished this. Started sometime around the evening. Was so worth it. Thank you very, very much, Les!
I do not usually watch long tutorials like that. Your style was amazing and right on point. Wish for you and your family all the best too
Thank You Les for this amazing course, You explain concepts well before diving into writing code instead of just writing code and telling us the end result. Really appreciate you.
Thank you so much for this course! I have been looking for a "best practice" course, that doesn't just use the controller and such. I can't thank you enough man! Great explanations and everything! :)
I really like that you don't edit the video to 'hide' any mistake. This can teach us a lot, as for sure we are going to find ourselves in similar situations. Keep up the good work!
You explain everything so clearly, I can understand most of your explanations the first time around and other explanations become clear with the coding demonstrations. Subscribed.
Great video, thank you for creating it. I appreciate the way you go into detail, demonstrate the possible pitfalls and outline areas that may require additional reading for those that are interested. I plan to review your other videos. I have purchased your book as a token of my appreciation. Keep up the great work!
As for me , this is by far the best tutorial on Web API so far(and I have seen different of them).
Great work!
Oh Hi Kenan - thanks for awesome feedback - made my day! Cheers, Les
That Was Amazing I Never thought i can get a full learning of dotnet core in 3 hours.
I Watched it second by second and Thank you for what you teached me
It is not a full learning of dotnet core.
This is great! I like that you break it all down into small and comprehensible steps. Very easy to follow
Thank you so much for this! I have struggled to find a slow paced, well documented and well explained like this, you are the best!
It took me nearly 8 hours to watch and do it on my own. I feel confident about my basics now. Thanks Les.
This course helped me immensely! I have one suggestion - how about updating the video with chapters (shown on the red bar)? UA-cam added the functionality in May and I think including them here would improve the experience a lot and help come back to the vid if you don't have the time to digest it in one sitting.
I am so glad I found this video on UA-cam! Wanted to brush up on the API concepts as I had lost touch of programming since 2yrs. Just completed the whole video and feeling confident now. Can't thank you enough Les! Keep it up!
Probably one of the best tutorials I have ever seen, cant wait to watch your others
Thank you so much Les 🙂🙏.
I haven't watched yet. But thanks for your hard work and you are an amazing teacher. Hope you make more videos and wish your channel all the best.
Please make tutorials on Microservices too. People need it. Thanks for your effort 👍😘
hi, let me know too if anything regarding micro service
why people need microservices?
@@fabiosouza8732 Because when you're developing for Cloud systems, you'd rather work with serverless computing.
@@TheDashang007 agree good idea
@@fabiosouza8732 alternative way of development with cloud computing. most of the company who use microservices have or planning to extend their product.
Great content -- not too much fluff, just straight forward and to the point. Finally someone who puts it all together just as we would in a professional environment without all the silly stuff
Excellent video, Les. I really like your style and the way you explain things along the way, with no b.s.
Thank you!
moment you started to speak, i knew i was gonna enjoy learning from you.
I can listen to you read a phone book!
a quick tip; instead of having to restart your dotnet server each time you make an update to your code, you can use `dotnet watch run`.
this will restart your server automatically every time you update your code =)
Great tip thanks!
Thanks for the tip! I just saw this as I'm wrapping up the tutorial lol. Wish I knew it was built in.
@@andrewtechful Glad I could help :)
Now making a note of that one. Useful.
Thank you so much for this, you helped me greatly as a programming student. The clear explanation and a bit of humour here and there was much appreciated. Looking forward to more videos. You seem like a great person, thanks again and take care.
I've finally found a course I can follow and successfully built this API. Massive thanks for your excellent delivery. Liked, subscribed, and bought your book 2 hours in.
Eureka, or Thank you, this was one of the most interesting course have followed ! Brilliant
In the beginning i had a choice, to watch avengers endgame or this video! Ended up finishing this entire tutorial in one go! It was so engaging! Thanks for The video, Les!
Love from India!😍
Thank you very much for this video Les!!! Spent my Sunday watching and practicing!!! I wish you all the best!
So glad to have you back! Please keep making content, they are amazing
Thank you so very much Les,
You have covered so much in it which i missed in other tutorials even the paid tutorials do not explain this topics. thank you very very much
May God Bless you!!!
Thanks Towseef!
What a great course, best 3hrs I have ever invested.
These videos are the best in the web! A lot of practice and knowledge. Everything condensed and showed in simple way!
Start to finish, you hit all the salient points and imparted what I needed. Thank You!
Thank you so much for this tutorial! Doing this on a text editor, as opposed to an IDE, made this tutorial much more educational.
I think it's time people should learn more about enterprise standard like this one. Topic on Identity, OAuth 2.0, Error handlers, loggers and schedulers would be great.
Yeah, this would be great.
I am not a security expert but Brock Allen is channel9.msdn.com/Events/DEVintersection/DEVintersection-2016/DEV09 and In fact Brock Allen Made Identity server.. Which will use OAuth2.0 for authorization..
Indeed, Authorization and Authentication would be great.
Also, a multi-model app would be great. For example, have a model "command" and a model "platform". Just to see how they can interact.
And versioning? Since the contract is fixed per version, when you want to add functionality, you should create a new version.
Seen any tutorial like that?
The course helped me out a lot! I went through a lot of ASP.NET Core API videos but this one is the best so far, thank you. Please make more videos, your teaching ability is very rare.
Thanks Les! you focused well on concepts+architecture with coding. Really liked and understood quite well the overall process by the end
Really Enthusiastic Learning session. Fantastic.
Really learned a lot.
Thank you very much.
Wishing you a very good luck.
Goodbye
Great effort and many thanks for such an excellent video
Hi Ahmer! Hope you're safe and well, thank you for your lovely feedback. Best wishes from a cold Melbourne! Les
Thank you for taking the time to explain this from start to finish! For once I was able to finish a tutorial without getting stuck because some detail or another was skipped. Wonderful Teaching!!
best video tutorial I have seen so far, I listen and followed word by word of this tutorial, I was able to build the API on my mac (using a docker sql container) and actually understood what I was doing. This reflects your ability to properly explain a topic, that is why I will be buying the book for sure.
Thank you, a great video,
I would very much like to be redirected to a place where i can see the best practices for make repo, like when you require a pagination, joining tables, etc ...
Many, many thanks! Going to get the book! You're a pro.
Thanks mate!
I have watched the entire video and implemented the API. Your teaching style keeps the audience engaged and is simple to understand. Looking forward for videos. :)
Thank You So Much... After trying out tons of tutorials I finally found this gem. Please keep making these videos. Much love from Sri Lanka. :D
Thanks Les Jacksen! Great informative video. However, I do have a question. How should I go about changing the format the api gives back? It's now a JSON, but say I want it to return a GeoJSON format or something, how should I go about making that happen?
Have to build a parser.
Why do you use VS Code? I did your tutorial with VS 2019 Community edition, and found it more convenient. Especially when creating new files, and using the NuGet window.
Great video, I learned allot. Thank you!
I did watch and try everything from this video. It actually helped me a lot because I'm at an internship on .NET and as it is something new for me, I rly needed some extra help. Thank you.
wow that was the best tutorial i saw on working with API's in . Core 3.1, well prepared content that can get beginners up and running in no time. thanks and keep up the great work.
me today : "meh.... nothing much to do today, just some basic stuff to do on scss...."
UA-cam : *DING DING MTHRFKR IT'S TIME TO LEARN SOME NEW STUFF!!!!!! Les Jackson just post a new online course*
me : "YIIIIIIIPIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII :D"
Thank you for your work, it's great and damn good !
Cheers from Switzerland mate
Thanks Maxime, and hello from down-under! Hope you enjoy the vid! Cheers, Les
If you get en error at 1:00:18 with SQL login, this video can help: ua-cam.com/video/aU8RhjdkCoE/v-deo.html
This worked for me, thanks!
This is by far one of the best tutorials. This is amazing, and well explained. Thank you very much, do not ever stop. Will be looking forward to more.
Hi Edward - thanks for the feedback mate - I appreciate it!
Learned a lot from your course! Thx for spending so much of your time on this tutorials and the community! I will definitely buy your book!!
00:00 - Intro
2:07 - API Demo
4:45 - Ingredients
6:50 - Application architecture
9:10 - Swagger overview
10:20 - Time to programming - VS Code - Create new project
12:10 - Application anatomy - what is what/Configuration
15:42 - Create Models
18:32 - Look at Architecture
19:19 - Create Data - Repository Interface
24:26 - Leave a like, subscribe and like this comment :)
25:00 - Create Data/MockRepo
31:30 - Create Controller 36:07 - API Endpoints 44:27 - Model binding for HTTP GET requests
45:40 - RUN & test with Postman
48:48 - Dependency injection overview
50:36 - Service Lifetimes
51:30 - Dependency Injection setup
54:50 - RUN & test with Postman
PART II Entity Framework, Database
55:36 - Application architecture
56:37 - SQL Server Management Studio - Configuration and RECONNECT
1:00:36 - Adding package reference - EntityFrameworkCore/Design/SqlServer
1:04:05 - Test - dotnet ef
1:05:25 - DB context
OMG I checked the description at this point
Thank you sooooo much brother!
This was seriously one on of the best and most detailed development videos I've come across.
Keep up the good work! :)
Les, I can't tell you how helpful this has been to me!!! THANK YOU
Hey Les, this video was of great help not only for me as an experienced but I am sure for begineers too, its too good! Appreciate your efforts and time spent on this. Keep up the good work and thanks a lot for this.
You are awesome Les Jackson, I was searching for a really awesome and in-depth tutorial and I found this one at midnight 12, O'clock and studied it till night 3 O'clock. Thanks for this tutorial.
Oh my gosh i love those tutorials. So useful and clearly explained. Thank you and we r looking forward to more videos from you man! Have a nice day.
Just want to say i learned more about Core with EF in the first 30 minutes of this tutorial than in any other video I've viewed..... very well done!
Massive thank you for explaining every step and making it so simple to follow through!
there are very few contents available on the internet like this ,Loved your straightforward explanations,Thank you very much ,this helped me alot
Thanks, Les, this is the best and most detailed REST API tutorial I have ever seen, much appreciated :)
Absolutely fantastic video. Learning .NET Core REST API couldn't be easier than this. Thanks s lot Les Jackson.
Brilliant! I just came on this by accident and it is so well done. I'm an old programmer dog trying to learn some new tricks and this has been immensely helpful..thanks again and cheers.
Brilliant tutorial!!!! Learnt a lot from just one video. I am going to watch all of your other relevant tutorials about cloud Azure. Thank you Les!!!
What an amazing video to quickly dive into .NET MVC. I've learned a lot by watching your video (and ofcourse programming with it at the same time). Keep up the great work!
Brilliant presentation, thank you for your amazing work on this channel! I stayed hooked until the very end.
It is THE BEST tutorial for Web API using .Net Core 3.1 that I've ever seen! Simple, trully step-by-step and easy to follow, yet comprehensive and following all modern standards and best practices! Keep up the good work Les - can't wait for more content! I might even buy your book...
Big thanks to Les! This is the best video I found to introduce ASP.Net Core Rest API on UA-cam!
Amazing content! Every second of the course is gold. I'll buy the book for payment in exchange for the knowledge provided. A grateful student.
Many thanks. The way you explain each and every functionality is just awesome. Thanks for all your efforts!!!
sir I can't appreciate enough these amazing tutorials! Please never stop making them. Love and admiration from middle east!
I am writing to you from Argentina, I want to thank you. With the clear way to explain the topics and follow your steps throughout the video, with another plus in my studies. I got my first job with .NET. Thank you!
Les, THANK YOU!!! Great video - very well done. You lay the content out very well and explain it even better.
WOW! Many thanks to you Les Jackson, it's wonderful learning from your video
A great training for me. Very educational. Very interesting. It's fun for more. Wish you all the best!!!
Man you are the best that i could have asked here in youtube and even in other platforms, thank you very much!
One of the best courses that i have ever seen ty. Nice work.
This is an EXCELLENT course. Les is easy to follow and he is a terrific teacher.
Legit only good tutorial on this I could find, thanks so much for taking the time to walk through this and have be a good reference point!
Just completed your entire course, All I can say is just amazing. People can actually go ahead and copy paste your code in theirs in the interest of saving time. Extremely well explained and kept the code to easiest to understand.
Hi Les,
You are life saver , Yesterday I was told to go through .net core web api as we need to deliver an api within 2 days. And this tutorial saved my day.
It got delivered on time. Thanks man. Cheers to you!!!
just wow jackson. your way of explain the thing is great... Thanks
Loved this course. Learned so much. Will be looking for more videos.
Thank you very much for this video. I am a developer for over 5 years now, and wanted to refresh my knowledge on .NET fundamentals and I found it very helpful. It is elaborate and useful.
Les, you saved me big time. Your videos are great, I almost lost a client because of me not understanding Azure and WEB API, two of your videos showed me everything that I needed, and now they are up and running. Thank you so much.
I just found your video from over a year ago and it was FANTASTIC. I ma trying to focus on a build a career in custom API work. This was a GREAT help in my learning and understanding the building blocks of API projects. THANK YOU! I'll search your channel, but if you can recommend perhaps the next step for me to watch so I may continue to improve this skill set, I'd be most grateful. Thanks again.
Fantastic video. Worked on an api a little bit ago and wish I would have watched this first. This video has very good content and thank you for making this tutorial.
I am a Brazilian computer science student and this video helped me a lot in the discipline of software engineering. This was really a great video, thank you very much !!!
Hello Les, thank you for this video, it helped me a lot with my interview test for a job here in São Paulo, Brazil. I didn't know anything about .NET. Thank you !!
Hey man! I am Brazilian and I live in Canada. I don't have the habit of leaving comments, but your video helped me a lot, extremely complete and I love the way you always stop and explain what you're doing. Much more than a tutorial, this is a lesson. You helped me a lot! Thank you!
Such a clean and to the point tutorial Les! I am very impressed. Thank you so much for making such tutorials.
You're very welcome Monika!
Hi Lee, long comprehensive vid - had to watch in few stages but was fantastic to help me see the transition from using .NET classic stack to build DIY web services - to current tooling and practice. Was nice to see lots of familiar concepts and challenges being addressed in intuitive way. I like your pace and no nonsense approach. Really appreciate the effort and contribution to the greater good. As we say in Wales - cheers butt :)
PATCH Method understood! I needed some orientation about how it works and how to use it. Thank you so much for the knowledge you share. Greetings from Central America :)
Watched full video with lot of patience. Very well explained