ASP.NET Core Web API .NET 8 2024 -1. Create Project + Install

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
what's up guys this is Teddy welcome to my YouTube channel this video we're going to get started on the net core web API course it's going to be aimed at beginners we are going to be building a stock markets social media platform where you can store stocks and equities you can comment on your stocks as well as add stocks to a portfolio in a user based system you'll be able to log in it's going to include security it's going to include JWT and best of all it's all going to be in Visual Studio code so we're going to go ahead no more talking we're jumping right in and first things first let's go ahead and download visual studio code now if you don't know how to download visual studio code it's incredibly easy it's pretty much one click you go to the top Google bar right here type in Visual Studio code go to the visual studio code website download for Windows you're pretty much good to go there's no further explanation needed because it's literally one click and it's designed to be very very simple that is the motto or that is kind of the thing behind Visual Studio code it is just a very simple editor okay so the next thing that we're going to do is I know that we're going to be using visual studio code but here's the thing if you try to install the net runtime I even had issues installing the net runtime if you just install Visual Studio by itself we're not going to be using visual studio but but if you install Visual Studio it includes the runtime it includes everything and everything is installed in just one little beautiful thing and you also get Visual Studio down the line as well too because if you're going to be working onnet in any capacity eventually you're going to have to use Visual Studio but we're just going to install Visual Studio as well even though we're not going to be using it we're going to install it so the first thing that you want to do is you want to type in Visual Studio not Visual Studio code and then we're going to go to visual studio and you need to make sure to install the community version you could install the professional version but the it's going to include a free trial Community is just free for forever and it includes pretty much everything that you need so we're going to go ahead we're going to install visual studio now my version of visual studio is already installed but it's going to look very similar so we're going to go you're going to probably see a screen like this then what's going to happen is that you're going to be brought to a screen that looks like this for this course all that you need is this one and this one and also I don't recommend installing node because I've installed node through Visual Studio in the past and it doesn't work well I've never installed python through Visual Studio and I honestly recommend just installing it separately also if you want to mess around with desktop development go ahead feel free to install these these will also work in Visual Studio code as well too so just to install these two up here my personal opinion but if you want to go crazy and install more stuff feel free to go for it I'm not going to stop you second thing is we need to install SQL Server the way that you install SQL Server is you type in SQL Server into the Google bar up here then you go down to the Microsoft you want to go to the official Microsoft version do not install SQL server in any other website and postgress you'll get taken to all types of crazy third-party download sites but with SQL Server you install through Microsoft do not install anywhere else besides Microsoft also I always go with the express version there is the developer version some people install the developer version but the express version is going to be great for 99% of cases and also if you need some of the features that the developer version has that the express version doesn't have you can install them later Microsoft will give you the ability to install them later okay so let's go ahead and install the express version it's pretty much going to be quote unquote like a fake install cuz I already have it installed on my computer but I'm going to walk you through it anyway and what's going to happen is it's going to check you're going to be brought to like a custom I would probably not do that I would just do the basic installation it's going to bring you through it it's going to ask you where you want to install it so go ahead and install it okay after you get done installing it what's going to happen is that you're going to be brought to this page right here next thing that you want to do is you want to install smss it's going to bring you to a page you want to go ahead click right here so once it's downloaded go ahead and open it and then you just want to click the install button so go ahead install it's going to load all the packages and it's also going to install with Azure data Studio you can also use Azure data Studio but we're going to be using SQL management studio and once you get it installed you'll see a screen that looks like this you can go ahead and close out of it okay so once you've gotten everything installed let's talk about something very important before we get started this course actually has a react front end with it if you don't want the react front end if you're not a react person and you're just coming for the API course just open a random folder and make a junk folder project or junk project folder put fin shark in it and create it just by going down here and creating a new folder then go inside that new folder and just open it up with Visual Studio code and it's going to look something like this it's just going to look brand new but if you are coming from react or you want to clone the react project I'll leave a link down with the GitHub and you can go ahead you can clone it and then what's going to happen is that your project is going to have a front end in it and this is what the project is going to look like for the rest of the course but I repeat you don't need the front end and you don't need this actual homepage PNG right here it's not required and you do not need the front end to in order to complete the API portion of this course but after we are going to be connecting the API and we are going to be connecting the front end and I will let you know when that happens but for right now you do not need the actual front end so in order to create a newnet project what we need to do is we need to open up visual studio code then what we need to do is we need to make sure that we are within the fin shark folder or whatever folder that you created for your project and all that you're going to do is you're going to type in net new web API hyen o and then we are going to type in API and what the o means is that it's going to actually name the folder if you just type in net new API like that it's going to dump all the contents in a folder and it's not going to look as good I think and then what you want to do is you want to type in API and once you do that you're going to see an API folder show up inside of your project now here's another important fact that could really trip you up whenever you are actually in the terminal this is the actual terminal right here you need to be very cognizant that you are within the right project so if you are just seeing this this means that you are not technically in the project you just in the folder that you make so you need to make sure that you CD into the actual API and once you do that you are pretty much good to go so once we've got everything installed we've got our actual API built the first thing that we want to do is we want to actually run this thing called net watchrun net watch run is pretty much like starting the engine of a car whenever you buy a new car the first thing that you're probably going to do is you're probably going to want to start the engine so let's go ahead and let's start it to make sure that the engine is actually working and the way that we're going to do that is first of all we're always going to make sure that we are within our API folder then we're just going to type in net watchrun when we want when we Run net watch run it's kind of a tongue twister what's going to happen is you're going to see this thing called Swagger now Swagger you don't really need to know much about Swagger Swagger is just a standard that is used to actually map API in points back in the day you actually had to have software to actually test your API and points but with swagger everything's built into a browser it autod detects everything and you will see what time what a wondrous thing Swagger is because it takes away a lot of the hard work of having to actually test our API so if you gotten everything correct if you installed net correctly you're going to see something like this the next thing that we need to talk about is our program.cs file our program.cs file is very important because it's pretty much like the back of our TV if you think about the back of a TV you really don't mess with the back of the TV that much but it's still very the back of the TV is very important because it's where things are kind of being plugged in and where certain types of settings are set and it's where you can only mess with some of the very important settings but it's more or less just kind of a fancy interface to plug things in and we're going to clean up our program.cs file right here we've got a lot of stuff right here this is actually a minimal API endpoint we're going to go ahead and delete this because it's just boiler plate code and we've also got a record right here which we don't really need as well to this is going to be all of the important code and all of this is what you need but let's talk a little bit about what's actually going on here this is a builder this is going to control things like dependency injection it's going to provide you with services and various things that you can actually add to your program almost like a module this is going to be what's going to control your actual pipeline the app is going to control the actual HTTP request pipeline Pipeline and this is where your middleware is going to be also various settings that you can configure and at the very end when this is actually executed the actual server is going to be run because things have to start somewhere and this is technically where the point of order or the Big Bang of your app is going to be we need to talk about API fundamentals now computers I say this a lot if you watch a lot of my videos I say this all the time but computers can only crud computers can't really do anything else you can't like a a computer really at the end of the day is just creating reading updating and deleting data but it's important to know what a lot of these verbs are because you're going to see things like get post update and delete and it's important to be able to kind of mentally map these because even though these are the exact same thing a read is a g a post is a create an update is an update and a delete is a delete it's important to be able to map these because most people are familiar with crud but a lot of people are not familiar with these API verbs so whenever you think of post just remember that a post is just a create whenever you think of a read just remember that it's a git and update and delete are pretty much self-explanatory also we need to go ahead into here this is going to be the last thing is we're going to install all of the extensions you technically I guess you don't need these but these are going to make your life a lot easier in the world of Visual Studio code so first things first just go back into Visual Studio code you want to go to your extensions file the way that you install most of them and the way that you install most of them at one time is you just go to the C devkit kit and it's pretty much going to install a lot of this for you but if it if you don't want to install C dev kit you could just install C by itself you can see this down here um and let's go to the do so we'll go to the net extension pack we also want to install the net extension pack and we want to install just pretend click we want to install the install tool as well because we need to install the uh nougat gal we need to install stuff from nougat and we also want to install nit Gallery so we're going to go nit Gallery we'll install nit Gallery pretend click I've already got it installed and we also want to install prettier as well too most time people have this already but if you don't have prettier make sure to install prettier because it's going to make things look a lot better and it's going to form metric code for you and also you want to use the extension pack by joose let me see here joose creative so go here the C extension pack so we say C extension yes by just creative and go ahead and install that and that's going to give the ability to just quickly go into here and add a C file and that's pretty much it after this we're going to get started on actually building out the API that was a very long video hope that you guys enjoyed this if you did make sure to smash that like button make sure to smash that subscribe button and as always thank you for watching
Info
Channel: Teddy Smith
Views: 13,818
Rating: undefined out of 5
Keywords: software development, programming, engineering
Id: qBTe6uHJS_Y
Channel Id: undefined
Length: 13min 31sec (811 seconds)
Published: Mon Jan 01 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.