C# MVC Flashcards
What is MVC?
MVC stands for Model View Controller which is an architectural pattern used in web and application development.
MVC is a way to separate business logic, interactions and presentation from the data itself.
Name and explain the role of each component of MVC
Model - the data that will be delivered to the view
View - components containing the user interface and is responsible for any user interaction
Controller - an interface that takes care of the communication and interactions between the view and the model
What is a model?
A model is an object containing data of a certain class.
What is a view?
Views are templates used to present data to the user. In this case Razor is the language used for view files (.cshtml)
What is .cshtml?
.cshtml is the document type used for view files and is a mix of C# and HTML.
What is a controller?
The controller handles the request from the web browser or other client.
Describe the components in the project structure
Files
Controllers - all controllers, one per file
models - all models, usually one per file
properties - project settings
views - all razor view files
wwwroot - client files like CSS, JavaScript and images