MVC1 WORKSHOP
1.
¬ Code first approach is an approach used by developers, where classes are created
first and then the database is generated from the classes.
¬ Database first approach is a method that focuses on creating the database schema
and from it generating the classes.
- Database first approach uses an existing database to generate the conceptual
model classes.
¬ Model first approach is concerned with using a visual designer to create the classes
and then generate a database from them.
2.
a. This is an alternative way of viewing and developing a web application.
A razor view is a template used to create dynamic pages for a web application, where
C# code is implemented within an HTML using syntax that starts with @ symbol.
b. The model consists of the data and business logic.
c. The controller acts as an intermediary between the model and view components.
d. A bootstrap represents a library or collection of data objects.
Bootstrap is designed to develop responsive website and includes CSS and JavaScript
components.
3. The camel case. This is the most useful because is widely adopted and used by most
programming languages.
4. This can alternatively be achieved using add migrations.
5. This could potentially lead to error in the database schema.
6. Database first approach.
7. MVC 8.0. This can be viewed when you initially create the project.
MVC2 WORKSHOP
1. The default route data will be stored in the Startup.cs file.
2. The HTTP post action method is responsible for data processing and retrieving data from
the server, while the HTTP get method is responsible for collecting and storing user
generated information.
The HttpGet method is used to retrieve selected data or entity from the database and
HttpPost method is used for data processing and submitting data to the database.
3.
Added state is related to the insert command.
Unchanged state won’t be affected by the SavaChanges method.
o No SQL statement.
Modified state is the edit command.
Deleted state is the delete command.
Detached state won’t be tracked by the database context.
4. The purpose of the dispose method is to terminate the database context after its lifeline.
This is done in order to free up space and memory for the application.