Asp.net core mvc (7.0 / 8.0) in one video | Asp.net core mvc tutorial for beginners

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
if you are looking for web development with csap then this video is for you in this video we are going to learn about asp.net core MVC framework it is a framework for creating web application in.net now what are the prerequisites for this tutorial first of all you should have basic knowledge of csap and HTML and you need to install a visual studio IDE and you need to install SQL Server management Studio once you have completed this tutorial and you want to build some more projects then you can check out this playlist of mine here build projects from scratch you will find complete tutorial or projects here if you find this video helpful then please hit that like button and share this video in your circle hey there everyone it's ravindra devrani let's get started without any delay first of all we need to install an IDE which is visual studio for that open your browser and type here download Visual Studio and click on this icon sorry link and we are gonna select this community version it is a free so here click on free download and it is going to be installed soon okay now it has downloaded Okay click on this file and select yes and click on continue a good amount of time it will take a good amount of time it it is not going to be installed so quickly and I already have installed the visual studio in my computer so I cannot move further from here but I am going to tell you that you have to select this one asp.net and web development please do not forget to select this one and you are good to go it is not going to be a very difficult process you will do it I know so once the installation is finished we will create a new project so let's start with creating a new project for that we will click on this Visual Studio icon and after that we will click on create a new project now you will find that we have lots of templates here and we need MVC template for that we will type here MVC and let's wait for a search result okay and here we have this asp.net core web app model view controller template we will select this template and click on next now we are going to rename this project and I will name it MVC core tutorial click on next and if you want to change this location you can change according to your need okay and I am going to use this latest framework which is dot net 7.0 so now let's create it now our project has created so let's run our first project so click on this icon and this project will be open on the web browser so it is our default application created by dotnet and now we are going to close it so before moving further let's discuss some of the terms and we will discuss about what is MVC or what is model view controller so first we will talk about model and model contains all data related logic like schemas of a database and it is a class basically it is a class and view contains a UI representation of your application and controller is a kind of mediator between View and model when request is made through browser controller handles it and Returns the appropriate view it also responsible for all the business logic now let's understand these things in a project so here inside the controller folder we Define our controllers and we have a home controller here and here index is a method which is returning a view and privacy and error also are the method which are also returning views so and Views are defined inside this folder and these are the views of Home controller index and privacy and we can go to the view from directly here foreign by right clicking the method name and go to view okay and there is also a shortcut for that when you right click in this method you will see Ctrl M plus Ctrl D so you can go directly into the view by clicking compressing Ctrl m g so that's how we retrieve our views here index is a method of controller and the UI representation of this method is defined inside here in the index.st csstml page which is the view of this method and we will explain it later how it is working and this error view model is a model class which is responsible for passing errors to the view from the controller or vice versa it is just a brief introduction we will explain it in later part and we will create our own view also on view models or database models also so let's talk about these files first one is application setting dot Json or app setting.json here we Define our some settings like we can Define here connection strings like this and we will Define it later and just briefing about it and ok so some project related information like connection string are gonna be defined here inside this app setting dot Json file and let's see what this program dot CS file is and it is the core of your application and here we Define all the services we need in our project or all the what we middle wears are defined here so here this Builder dot Services Dot add controllers with views is saying that we are gonna use controller and Views in this project so we can say that whatever services are needed application will be declared here now they will be declared here in this section okay after that here we will sorry and in this section we will Define our middleware and what is middleware first of all so middleware is a piece of code that controls the flow of HTTP Pipeline and they will be invoked between request and response it means that you cannot move further until you pass through a middleware so this app dot https redirection use static files use routing and so on till here these all are our middlewares and we will Define every middleware here so it is a section for middleware so I'm gonna write here section 4 configuring middle wears so when you made a request then first your application will build then it will go to this middleware after using this middleware and passing through this middleware it will move to this one then this one then this one then this one and finally it will go to your response it might be confusing at this part but when you will create your own projects and you will use those middlewears and some more middlewares then those things will be more clear to you so do not worry about it just go through it briefly you will understand eventually about it do not worry focus on the logic part and you can learn these things later also so we will move to this www root folder and all the static files like CSS jss JS or images will be defined here so WWE root basically contains some static files like CSS JS and images keep in keep it in your mind and inside this properties folder we have a long setting file and here we have defined the launch URL for our project okay and it's not that much important right now okay here we have our dependencies okay so now we have gone through briefly all the section of this project now let's run our project again and I'm gonna show you something and you might be wondering that why this page is showing by default why isn't other Pages displaying and where we have defined this default page for displaying so let's see where it is defined okay and inside this program.cs file you will see a routing section but first we will see that how routing works and we are going to open the new tab and here we will write the name of controller and name of method so it is a route here we have a base URL of the project now slash minimum of controller slash name of U so it is how a root works if we are hitting this URL it means that we are executing a index method which is defined inside this home controller here we have this home controller and this index method and when we are hitting this index method it is returning as a view and here we have this view so that's why we are seeing this view page here I hope you understood the concept now let's move to the home page and you might be wondering that why I am not seeing here like this home slash index because it is the same as this page and this page is same there is no difference because it is a default page so it is not going to show the full URL default page does not show the full URL okay that's why we are not seeing a full URL and inside this program.cs file we have defined a default URL it means that whenever you run this application the first URL will be hit home slash index so it is going to be your default URL and it means the index view means index method of view controller will be executed first in your program so I'm gonna write here index method of home controller will be executed first thing in this application okay and it is uh default URL so now we will see how to access this privacy method or privacy View so for this we are gonna write here slash name of controller and slash name of method which is private sorry not private it is a privacy okay and it is not a case sensitive here privacy so here we are seeing our privacy policy page okay I hope you understood all these terms now I am gonna remove all these files and we will create these things from the scratch so that we have more clear understanding about this project okay I am going to remove this one and this home controller guy inside this shared folder I am gonna delete this this and this okay and we will not delete this view Imports dot CS HTML page otherwise it will give an error we need this page and inside this file we are going to comment this and we are also going to remove these folders also they are going to take some unnecessary space so I am going to remove it and we will use our own CSS files okay now if we try to run our project let's see what happens and we are getting some errors here so let's click here and remove let's comment this thing okay and let's not comment this one only comment this one okay let's see still we are getting some errors okay it is saying MBC code tutorial could not be fined found okay by the way let's comment it for now so for commenting the code you have to select these two line and press Ctrl k C okay let me show you select these two lines and here press Ctrl K and c and it will comment these two lines okay you can also find this thing here somewhere here okay let me find first last uncomment this and select these two lines and you will also find it here inside this edit advance and here comment section and its shortcut is Ctrl k Ctrl C okay and for uncommenting use Ctrl K plus Ctrl U that's it okay now let's close it and let's try to run it again so it is saying that this localhost page cannot be found because we do not have the home slash index page which we have defined here because it is our default page home slash index and it is not finding this page so it is giving us an error page not found okay so let's close this tab now let's create our own controller for that right click here in the controllers folder and click on ADD section and controller okay and we will select this MVC controller empty now let's rename it to let's name it person controller click on ADD button and here we have created our first controller which is person controller and it have this index method okay let's see how to create a new view for that we have to click on this index okay and it's very simple right click here in the name of method and click add View and here we will select this razor View click on ADD now here it is asking create as a partial you know use any layout page no click on ADD button now or you has created you can see it here inside this views folder it has automatically created a folder named person and inside that it has created a file index.cs HTML5 and it is the view of this index method so we can also go there by go to view or by control M plus Ctrl Z okay so it is our view and let's remove this boilerplate of HTML code okay just right here hello world okay and click on this icon and we will see it in the browser and we have not set any default phase so it is not going to show anything by default for accessing that page we will write here person slash index so it is the index page for that person controller now let's define it as a default layout page so right here I'm gonna write person and it will be the same index now let's run it again now person slash index has been set to the default URL for our application and let's close it for now right now we have been using a static content here but you want that I want to set it by programmatically for that we have three methods sorry not methods and three techniques we can say techniques by which we can pass data from this controller to this View and let's see how can we do that first one is view bag and we will write view back dot greeting equals to hello world okay it is the first method for doing this and here we will write view back Dot and what was the name greeting Blue Back dot greetings okay let's see how is it going okay it is working fine we have sent this greeting from our controller to view and with the help of view back now we will use another methods for this and we have two more things second one is view data and it works like this view data Dot let's name is greeting two let's rename it and okay let's pass a message which is I am using view data or view data and we have one more thing which is temp data temp data dot greeting three equals to its temp data its them data message okay let's see how can we display it here okay let's copy this and here we are using view data Dot greetings to and temp data greeting 3. okay let's run it and let's see how is it working okay everything is working fine we have these three messages which we had sent from the controller to the view okay let's see what is the difference between them this view bag and view data is used to view back and view data can send data only from controller to view but temp data can send data from controller accent to action okay and right here temp data can send data from one controller method One controller method to another controller method so that's a difference between view bag and con view bag and temp data or view back view data versus temp data so if you only want to send data from View controller to view you will use these two these two guys and if you want to send data from one action method to another action method then you will use this temp data and this temp data can also be used like these two guys it's out it's up to your choice but we will not use these things too much in a real world scenario these can be declared as a bad practice because they use sessions and they can be burdened on the server so in the real world you do not have to use these things using these things are considered as a bad practice because they are nothing but assassin okay now let's create a layout page for that we are going to create it inside this shared folder and we will right click on this shared and click on ADD okay a new item and let's search it here okay it is going to take some time okay and let's try to search it here layout page a razor layout and let's select it and let it be like layout.cs HTML okay so it is our layout page and it is a basic layout for our whole application and the other Pages which can be called as content pages will be defined here so we can see templates content pages will be loaded here they will be loaded here inside this render body method or this render body method will automatically load those content pages okay so let's use our layout page here so inside this we will write layout equals to layout Dot csstml or let me see just layout let's see is it work or not and it is a one way of using layout page in your views and another method will be from we will use it from here but we have commented it so we are using it from here for that you have to write layout equals to and name of your layout page which is layout okay let's see is it working or not for that let's define something here and let's write H2 hello there and right here content goes there so let's run it and check it in browser is it working or not so it is working fine okay let's define another method here so we can understand it more clearly for that I'm going to create a method public IX and result and let's name it add add let's name it add person and it will return a simple Plain View and let's add a view for this so we will write add and view empty and let's name it add person foreign Ty View and we will also write here layout equals to layout okay and let's run our project so it is our index page and let's call the add person page okay it is giving an error so let's see the view layout could not be located okay it is a spelling mistake so I'm gonna correct it okay here it's l a i l a y o u t layout and let's define something here paragraph and details of person something like that so that we can distinguish these pages okay let's see how is it working so it is our index page and let's call this person slash add person page here and it is our add person page and you can notice that this hello there content goes there is same in both Pages hello there content goes there and hello there content goes there because it is defined in our layout page and it is going to be same whenever you will use a layout page if your if your view is using layout page then this in this content is going to remain same in all those pages and it will be changed according to your url so here is our so this section is our layout page and this section is our content page so content goes here so I guess it is clear to you okay and we will understand it in future so please be patient do not worry and what is layout page and what is this content page just relax and watch the video we are going to learn it eventually and slowly and do not worry so let's close this window for now and let's see what we can do now okay we will use models and one thing has remained from MVC which is the first term and we haven't used it yet it is our M for model so let's create a model model is not anything is special it is just a plain class so for that right click here on models click on ADD and okay we need to create a folder it will be best if we separated the things so we will create a folder domain and here we will Define our model so yeah click right click here and click on ADD class okay let's name it to person okay and here we will Define some details of person like ID and name of person a string name and just an email that's it and we are not going to Define anything and let's put this question mark here now this property is nullable okay so we will bind that method to our math method to our model for that we will create an another method and this method is going to be a post method HTTP post method and this one was a it is a get method okay and it is a post method and right here person and object of that person that's it okay and okay leave it and like it and actually we will use it later for now let's leave it just as it is and now let's use this page which is layout.cs HTML and we will Define some good designing part here for that we are going to use mood strap and let's type here bootstrap click on this get bootstrap and let's see how can we use it okay let's go here in the docs section and we are gonna use this this this this this this let's see okay let's use this so copy it and let's paste it here and let's remove the previous one and here we will use the div plus equals to container and here we will Define our content pages so render body okay now we are using the template of bootstrap for that we are going to use the name bar and this one is called an a bar this okay we will use the neighbor and that's fine yeah here click on this neighbor and do not worry about it just copy this and paste it here so let's paste it here okay yeah that is absolutely fine okay let's run it and let's see how is it working okay so now our project is looking much better and yeah it is fine okay let's see what we can do now now we are going to connect it with database and I'm going to use this SQL server and if you haven't installed an SQL Server you can download it from the internet so let's see where we can find it so type here download SQL management Studio and you will find here download SQL Server management Studio so here you can find the link it is saying that free download for SQL Server management Studio okay so actually I'm not going to download it because I have already installed it in my computer and you can download it and install it so if you haven't installed it please install it before moving further okay let's close it so first of all let's define our connection string and here we will type connection is string and let's name it Con here type here data source and open your SQL server and copy this value server name it is a name of server so copy this name and paste it here so here we Define the name of server data source equal to name of server and initial catalog initial catalog and it will be the name of database so you can write any name I am going to write the MVC store tutorial tutorial okay and at the end we will write Integrated Security equals to true so that's it let's close this file and now we will install some nuget packages so right click now right click just click in this tools icon and here man nuget package manager manage nuget package for solution so we need to install two packages from here the first one is okay it is taking time so the first one will be Microsoft dot okay it is ticking a little more time so let's type here Microsoft Dot Entity framework core dot SQL Server so we need to install this package select here the project and click on install and it will ask permission for installation I guess it is going to ask okay let's do it and let's see how much time it is going to take it depends on the speed of the internet and the speed of your computer okay and we are going to accept it because we need to install it okay I guess it has installed now we will use another package which is the dot tools and this one I guess tool or tools yeah so click here and click on install and accept okay packages has installed now let's close this tab and right here right click in this domain folder and we will create a database context class so click here and add new class let's name it database context so that's it and and it's I have missed T here so I'm going to rename it to database context okay it's fine now and let's inherit a class here it will be DB context press and after that press Ctrl Dot and click on this using Microsoft Entity framework core and it will add this line here using Microsoft dot Entity framework code now we will Define a Constructor here so type ctor double tap and it will create this Constructor and it will inherit a base Constructor which is asking me a DB context options so here we will write DB context options name of our class so it will be database context and that's name is opts and pass this opts here foreign now here we will create a DB set of our person class so type here p r o p double tap it will generate a property for you so right here DB set and DB set name of model which is person and name it to person now this DB set what it will do it will create a table in the database with the name of person and nothing more so it will create a table for you in the database and you will access it through this DB set inside this application you are not going to write any SQL queries because you are we are using Entity framework code here and if you need some more information about Entity framework code you can check out my video on Entity framework core in one video in my YouTube channel you will find a much more thing about Entity framework core in this tutorial I have created it for you so if you want you can check it also and let's close it for now okay now we will not talk about interior framework core and move further so here it is our database context class and let's close it and now let's move here inside this program.cs file we will write some code for connectivity to the database so here at this line and what it is going to do it is going to configure your SQL Server here that it is basically telling that we are using this connection string and please create a connection with database something like that and that is simple and you do not need to remember these kind of lines please note it down somewhere so that you can use in future I also do not remember these things that's why I have copied it and this kind of thing happen you can't remember every code focus on logic do not focus on remembering the code so that's the point here so here Builder dot Services dot add DB context okay this options and write it down or copy it from the project which I am going to provide you in the description box so I will put down the source code in the GitHub or some other kind of repository or I can put it on the where Google Docs and wherever why wherever I'm going to put that project I will give you a link in the description box so do not worry about it so now let's run the migration commands for that click here on tools and here nuget package manager click on package manager console and we are going to create our first migration file so right here add migration let's name it init so it has created a migration file now what we will do we will write here update database and this table which is person is going to be added in a database and it will automatically created a database which we have defined here it is going to create a database with name MVC store tutorial or OK MVC store not MVC core MVC core tutorial fine just type here update database and let's wait build has started build has succeeded the connection property has not initialized okay let's see okay I am going to remove this migration file because I have changed in connection string so I'm going to remove it okay here [Music] okay and I'm also going to remove this okay and let's try to run this command again okay and now type here update database let's see okay the same error and let me find what is the error okay let's open the connection string okay let's see what is the error so it is the name of our connection string gone and inside the program.cso I have to write here this gun okay so it was the error this name con and this name should be same so I guess we won't get any error now let's update the database and let's see what happened but this time I am pretty much confident okay and I was wrong we are getting error again so this time it is saying connection was successfully established with server but there is error with login process and it is basically Authority is used okay let's add a line here and it will be trusted server certificate equals to true let's see it resolves a problem or not so I am going to use this update database okay and let's see yeah we are done if you are getting this error then add this line also trust server certificate equals to true so now our database has created and we also have created a table inside that database which is a person table so now let's move to our person controller and where it is yeah it is here so let's close this tab for now person Tab and this migration file foreign but I forward one thing we can also use layout page in another way for that here we do not need to Define this line and we just move we are going to remove this line from our view pages and we are writing this line here inside the view start.cs HTML page okay and it will do the same thing before let's see how it is going yeah and it is working fine so let's close it for now and move back to our Visual Studio so here we will write some code so what we will do we will add a form inside this add person view so we are going to use the form from the bootstrap so let's find it and let's see where we can find it from yeah here okay and let's copy this form and paste it here so let's change it according to our need and we need person name and email we need only two Fields person name and person email and this one will be input type equals to text okay and remove this one okay it's fine and name for name input type equals to text class equal to form control ID we do not need ID here we also do not need this thing we are we need just plain things so name and here I do not need this email help so here we will use email and right here we will write asp four name but before that we need to Define here our model which we are going to bind to this view so we are binding a model to this View for that we have to write at the rate model and name of our project which is MVC core tutorial Dot controllers not controllers dot models dot domain dot person so we are going to bind this person model to this View and just copy this esp4 to this to here and here and here also and it will be not name it will be a email and it will also be a email okay now we will Define a div here and let's name it Style width 50 percent cut it from here paste it here and let's define here H2 add person that's fine and here we will add and Link a href class equals to vtn BTN default and BTN let's say vtn primary and it will be whole person and we will Define the hrefr later so let's see how our form is going let's add a class here padding or margin top two okay and right here person let's add add person yeah it is our person at person view and it is not going to perform any submit action for that we have to define a name of method so here will be ASP xn equals to add person let's see let's add a breakpoint here so just click here and let's run it but before that we need to stop it and open this program.cs file and change this to add person now it is fine so we have added this view to default setting or default URL whatever you say it and let's add something here name equals to John email equals to John at the red xyz.com and let's see we are getting values or not so first of all we are hitting that add person method and yeah we are getting values so till this point we are fine now we will add some validation logic into this person model so open this model go to definition and we are going to make this thing required copy this one and paste it here and also we need this as email address so if we write here if model Dot okay it is capital model state DOT is valid and we are writing this negation sign here it means if our model is not Welling valid then we will pass this message temp data okay we are not going to pass this time data we are just returning from here okay and otherwise we will write here temp data message equals to added okay and we are not adding these values to the database and I am just explaining it to you how it works and how validation works so let's run this okay and let's close it I forgot one thing and right here okay we will check if model sorry not model temp data MSG doesn't equals to null it means if we are getting a message from temp data then we will show it here so here we will display a message which will be temp data Dot MSG and we will add some validation match Magic not magic some validation messages here so we will write we will write something like span and class equals to text error no text error it's a text Danger and ASP validation 4 name is in its sample it is very simple and we will copy it and paste it here and we will change it to email that's it and let's run our project let's see how is it working okay okay first we will not pass anything let's see how flow is going so we have returned from here now let's add something to it and let's see what it is saying email field is not a valid email address so we have to pass a valid email address which is like this and yeah it is saying added so we are good so far now what we will do we will Define some database connectivity here for that we are going to create a Constructor very good and here we will write private read only database context CTX and it will be a underscore CTX let's copy this guy and paste it here and remove this under score so that we can distinguish both names now right here CTX equals to CTX and it is called dependency injection okay right here a try crash block try catch block okay why we are not why it is yeah it is working exception ex and from here we will write temp data Dot message could not added that's it and it we will return A View from here and from here we will write it successfully now we will return to some method so return to redirect to action and it will return redirect to this method so copy this and paste it here okay fine now let's write CTX Dot add this version here CTX dot save changes okay I guess it is fine not at all any problem okay let's see how it is working so let's add a person here so let's name it John it's on at the gmail.com and let's see yeah it is saying added successfully let's add another name Max and Max at gmail.com add one more and let's name it Mary at the red gmail.com let's add one more so let's name it x y z and x y z at the rate gmail.com okay we have added four records now we will display them somewhere for that we are going to create a new method public IX and result display persons okay and it will written a view written View we will write some code here like where persons equals to CTX dot person dot to list and we will pass this person to this view that's how we pass an object of a class to The View so watch it clear watch it vary carefully I am creating and I am getting this object from from our database using this contact class CTX dot person.2 list and I am passing this persons to our view and we will create a view so it is going to be a empty View and display persons so let's name it display persons and let's copy okay I'm not going to copy actually we do not need that much copy part we just have to pass here at the rate model I enumerable name of our project which is MVC core tutorial Dot models dot domain dot person that's it and okay we are going to copy some of this part so let's copy it and paste it here first of all we do not need this form and we do not need anything from here accept this one and it will be add person so we will Define it here do class equals to row div class equals to call MD 4 and add person and we will Define the controller name Person slash add person here inside this view now we can Define person slash display persons foreign now right here persons and we will create a table here so right here table class equals table table stripped the head t r t h name email TR D and we are going to use a for Loop here for each Loop here for each where for each where person in model and put this Dr here now we will write person dot name add the red person dot name and add the red person dot email so that's it we need another here xn and right here TD and let's name it edit and delete so let's run it now we have linked this what we say this button to a page and we can go from here to that page and we can move back here so it is good okay and we are displaying our data here so let's add functionality for edit and delete for yeah first we will Define the functionality for edit okay and okay but before that we are going to Define some links here first of all I do not need this search bar here and we do not need this link and probably we do not need anything here we will Define our own links so just remove it from here and it will be our home page so it will be person slash index and let's name it index page person slash add person add persons that person and persons or name it display persons and it will be displa y display persons and let's see how is it working okay and it is not working fine so I think I have matched it with okay I have defined them inside this Li which I do not need to do so first of all let's talk this project and right here slash Li we need one more Li now copy this guy here and copy this guy here it is our anchor tag and yeah I guess we are fine now control KD it will format our document so let's see how is it working okay and it is the link index at person display person everything is working fine okay let's change the color of neighbor that is not looking that much promising so I am going to use this dark one and here let's see where we are going to paste it nav class equals to so where is our nav yes here nav class equals to its nav bar now bar dark okay let's run it again okay now we have applied the dark nav bar okay and let's change this nav bar here so first of all we need to stop it and where is it never change it here MVC core tutorial MVC core tutorial and let's copy this link and paste it here fine so let's run it again yes everything is working fine let's click here okay we are moving to index page and where we want it okay now everything is working fine now let's add this edit and delete functionality so I'm going to close this tab for now and also this tab we are not going to use bootstrap any further in this project okay now let's close this layout.csstml tab and move to the person controller first we will Define a delete method here so okay let's copy this one and paste it here and let's name it delete person and it will get an ID as a parameter so first of all we need to find a person with the given ID so here right where person equals to CTX dot person dot find and it will give you an object with this ID so if person doesn't equals to okay it is a person so if person doesn't equals to null but first of all let's just Define a try cash block here so we will Define it inside this this block and ex okay if person is not null then we will remove it so right here CTX dot person dot remove add person and here I think I have missed something we can also write this that person dot add person okay and just type here CTX dot save changes now your record has deleted from the database and that is pretty much good now we will return to the accent return redirect to xn and after deleting record from the database we will move to this display person's method so that was the idea we will delete we will delete a record then we will move to the display persons page and let's add a functionality for edit so let's copy this line and paste it here foreign written View so we will find a person here like we have did before and we will pass this person to The View and now we will create a view so add View and name it edit person okay and let's rename it to edit person now open this file add person and select all the things and copy all the things and paste all the things here now rename here edit person and change it to edit person so that's all and we need one more thing here we need a hidden property of ID field so just paste it here for ID and it will be a hidden type okay and let's name it to update okay and let's name it back okay so here now we need to Define these links so it will be href equals to name of controller person slash name of method edit person and ID equals to person dot ID copy this and paste it here and it will be delete person delete fine now it will take class and BTN BTN [Music] success and it will take class p t n v t n Danger that's fine okay let's run it and see how is it working okay let's move to display persons and right here click on this edit button and let's change it to x y z 1 2 and it's 2 x y z one two two let's see is it working or not and it is not working because we haven't defined an update method for it so here we need to Define an update method which is going to similar this add person method so I'm just going to copy it and just rename it everything is going to be so much similar we need to change it to update and right here updated successfully actually we do not need it here okay could not updated and when it is updated it will move to the this display person method okay so I guess everything will be fine okay so let's see how is it working so let's move to the display persons now let's try to edit this record let's name it to xyz12 it's okay we have updated it and now let's try to delete this record and we will try to add another record and let's name it ABC ABC at the rate y z z dot C and yeah add it successfully and everything is working fine so far we are good okay guys now you have basic idea of asp.net core MVC how this framework works you have a pretty good understanding of this framework now you can create some good projects with it now and I have made tutorial of several projects in MBC you can check it in my channel and here it is the playlist for the projects build projects from scratch here you will find you will find these two projects so if you are interested you can also check out this content and build your own projects so that you can understand this framework more clearly so that's it for today guys and if you find this video helpful then please hit that like button and don't forget to subscribe this channel see you next time
Info
Channel: Ravindra Devrani
Views: 27,824
Rating: undefined out of 5
Keywords: dot net core tutorial, dot net core 7, crud operations in dot net
Id: e2I7EzuCt1g
Channel Id: undefined
Length: 88min 19sec (5299 seconds)
Published: Thu Nov 17 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.