.NET Basics
Module 4
Web APIs
Decipher The Code
Entity Framework
100

This term is used for a blueprint from which objects are created.

What is a class?

100

This concept allows one class to inherit properties and methods from another class.

What is inheritance?

100

This is the URL used to access a specific resource in a Web API.


What is an endpoint?

100

This represents a session with the database and is used to communicate with it.

What is the DbContext?

200

This is the method that is called when an instance of a class is created.

What is a constructor?

200

This type defines a contract that classes can implement.

What is an interface?

200

This type of class is responsible for handling HTTP requests and responses, including routing an endpoint to a method.

What is a controller?

200

This represents a table in the database.

What is a DbSet?

300

In C#, this type of collection is especially useful for storing key-value pairs for quick lookup.

What is a Dictionary?

300

This keyword allows a method in a derived class to provide a new version of a method from the base class.

What is override?

300

This layer/class type is responsible for communicating with the database.

What is the data layer or repository layer/class?

300

What is We inject it into a controller or service class, it separates database access from controller logic, and makes our database methods reusable throughout the app.

300
This is the process of defining and tracking how your database schema changes over time, and determines how changes are applied.

What is a migration?

400

These are the main benefits of using enums in C# over using magic numbers or strings.

What are to organize constants in a maintainable way, improve code readability, control state, and to have type safety?
400

This concept allows different classes to be treated as the same type through a shared base class or interface.

What is polymorphism?

400

A controller directly uses DbContext to query the database instead of calling a service (or even data) layer. This is an example of violating which principle?

What is separation of concerns?

400
What is dependency injection?
400

This is a simple explanation of what Entity Framework does for us.

What is maps C# objects to database data and vice versa, and simplifies data access?

500

This method and file of a C# program serves as the entry point where execution begins. In recent .NET versions, we don't see the method name, an empty file that is technically within this method...

What is Main() in Program.cs.

500

If you want a method to be REQUIRED for derived classes but NOT implemented in the base class, you would use this combination.

What is abstract method in abstract class?

500

What should be changed in this code snippet?

[HttpPost]
public IActionResult CreateUser(User user)
{
    _userService.CreateUser(user);
    return Ok(user);
}

What is use a DTO for the request and response.

500

What is loading all movies into memory before filtering?

500

A developer writes the following, ___ is making this inefficient, ___ is what you would do to improve it.

https://rheinbokel.atlassian.net/wiki/spaces/~5a2d703b31518d38276eb612/pages/334823425/Jeopardy+Part+2+Code+Questions#EF-500

What is: executes the query immediately and filters on collections in memory.

What is: Build a dynamic query and execute at the end, with all filtering done in the database.