Entity and View Model

Learn about models in MVC and creating an interactive UI with entity framework core integration.

In MVC, the M stands for the model. Models represent the data required to respond to a request. There are two types of models commonly used:

  • Entity models

  • View models

Entity models

Entity models represent entities in a database like SQL Server or SQLite. Based on the request, one or more entities might need to be retrieved from data storage. Entity models are defined using classes since they might need to change and then be used to update the underlying data store.

View models

All the data that we want to show in response to a request is the MVC model, sometimes called a view model, because it is a model that is passed into a view for rendering into a ...