This term is used for a blueprint from which objects are created.
What is a class?
This concept allows one class to inherit properties and methods from another class.
What is inheritance?
This is the URL used to access a specific resource in a Web API.
What is an endpoint?
This is what will be printed to the console in this code:
What is 1, 3, 5?
This represents a session with the database and is used to communicate with it.
What is the DbContext?
This is the method that is called when an instance of a class is created.
What is a constructor?
This type defines a contract that classes can implement.
What is an interface?
This type of class is responsible for handling HTTP requests and responses, including routing an endpoint to a method.
What is a controller?
This is what will be printed to the console from this code:
What is Bark?
This represents a table in the database.
What is a DbSet?
In C#, this type of collection is especially useful for storing key-value pairs for quick lookup.
What is a Dictionary?
This keyword allows a method in a derived class to provide a new version of a method from the base class.
What is override?
This layer/class type is responsible for communicating with the database.
What is the data layer or repository layer/class?
This is how and why this code gets used:
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.
What is a migration?
These are the main benefits of using enums in C# over using magic numbers or strings.
This concept allows different classes to be treated as the same type through a shared base class or interface.
What is polymorphism?
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?
This is the design principle used here (in the constructor):
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?
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.
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?
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.
This is why this code is inefficient:
What is loading all movies into memory before filtering?
A developer writes the following, ___ is making this inefficient, ___ is what you would do to improve it.
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.