FREELessons: 20Length: 2.3 hours

Next lesson playing in 5 seconds

  • Overview
  • Transcript

2.3 Models

Hello, and welcome to back to MVC for designers. In our last lesson we took a look at views in Visual Studio. Where we can find those views and what exactly they are. And in this lesson I wanna talk about models. And as you can imagine, you can find the models for your given project in the models folder. If we expand that out, we can see that this default MVC project already has a few models already in it. So I'm gonna click on this AccountViewModels.cs. And as you can see, this is simply a code file. It has a .cs extension which means it's a C# file. And it might be a little intimidating at first if you've never coded before. But if you look closely it's basically a series of view models. And a view model is basically a model that contains data for a given view. So this particular file, AccountViewModels.cs, has a view model for external login confirmation. And the only data in that particular view model is a string representing an email address. We also have an external login list view model. And the only data in that view model is a return URL. Another type of model that you might have in your application might be the customer model. The customer model would have data like a first name and a last name, maybe a customer ID, a shipping address, things like that. So your models really just represent the data in your application. Now again, since this is a programming course, we're not gonna spend a whole lot of time worrying about models. We're not going to worry about things like field validation and things like that. We're gonna keep it pretty simple. And if we touch on models at all, it's going to be on a very simple, easy to understand level. But even if you won't be doing any coding within a model, it's important to understand where those models are, how they work within the MVC framework, and where you can go to find those models. So thank you for watching and in the next lesson we'll take a quick look at controllers.

Back to the top