C# MVC Flashcards

1
Q

What is MVC?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Name and explain the role of each component of MVC

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is a model?

A

A model is an object containing data of a certain class.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is a view?

A

Views are templates used to present data to the user. In this case Razor is the language used for view files (.cshtml)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is .cshtml?

A

.cshtml is the document type used for view files and is a mix of C# and HTML.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is a controller?

A

The controller handles the request from the web browser or other client.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Describe the components in the project structure

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly