Shadow properties are fields that aren't present in your entity class but are represented in the database. You define these using the _________ method in Fluent API.

  • HasField
  • HasShadow
  • AddShadow
  • DefineField
Shadow properties are fields that exist only in the database and not in your entity class. You can define these using the HasShadow method in Fluent API when configuring your entity in ASP.NET Core Entity Framework.

After writing your ASP.NET Core application code, you want to build and run your application using a command-line tool. Which tool would you use for this purpose?

  • .NET CLI (Command Line Interface)
  • Git Bash
  • PowerShell
  • Command Prompt
To build and run your ASP.NET Core application from the command line, you would use the .NET CLI (Command Line Interface). It's a powerful tool that provides various commands for managing and running your ASP.NET Core projects efficiently.

Shared Razor directives that are intended to be used across several views in an ASP.NET Core application are typically placed in the _______.cshtml file.

  • _ViewImports
  • _Layout
  • _Partial
  • _ViewStart
Shared Razor directives that are meant to be used across multiple views are typically placed in the _ViewStart.cshtml file. This file is executed before any view is rendered and allows you to set common layout or content directives for all views.

You are just starting with ASP.NET Core and are looking at a piece of code in the Startup.cs file with endpoints.MapControllerRoute. What is the purpose of this code?

  • Configuring routing for controllers
  • Defining a database connection
  • Setting up authentication
  • Handling exceptions
The code endpoints.MapControllerRoute is used to configure routing for controllers in ASP.NET Core. It defines how incoming HTTP requests should be mapped to controller actions, allowing for dynamic handling of URLs by your application.

Which action result type would be best to use if you want to navigate the user to a different URL from the controller?

  • ViewResult
  • JsonResult
  • PartialViewResult
  • RedirectToActionResult
If you want to navigate the user to a different URL from the controller, the best action result type to use is RedirectToActionResult. It issues an HTTP redirect to another action within the same or a different controller, allowing you to redirect the user to a different page or route.

What is the primary function of the dotnet command when used without any additional arguments in the CLI?

  • Display a list of available .NET Core versions
  • Create a new ASP.NET Core project
  • Run the last executed .NET application
  • Show information about .NET Core CLI commands
When you use the dotnet command without any additional arguments, it displays information about available .NET Core CLI commands. This helps users understand what commands are available and how to use them effectively.

In a Dockerized ASP.NET Core application deployment, which command is used to build a Docker image from a Dockerfile?

  • docker push
  • docker create
  • docker build
  • docker deploy
To build a Docker image from a Dockerfile, you use the docker build command. The Dockerfile contains instructions for assembling the image, and this command creates the image based on those instructions, making it ready for containerization and deployment.

Imagine you are tasked with creating an e-commerce website where page load speed is a priority, but you also want the benefits of ASP.NET Core. Which project template would be optimal?

  • MVC
  • Razor Pages
  • Web API
  • Blazor Server
For an e-commerce website where page load speed is crucial and you want the benefits of ASP.NET Core, the optimal choice would be the Web API project template. Web APIs are designed for delivering data efficiently to clients, making them ideal for scenarios where performance is a priority. You can still leverage the benefits of ASP.NET Core for high-performance web services.

You are developing an e-commerce site using ASP.NET Core. For the product details page, you want to have a consistent header and footer but a unique middle section. Which Razor feature would be the most suitable to achieve this?

  • Razor Layouts
  • Razor Components
  • Razor Partials
  • Razor Sections
Razor Layouts are used to create a consistent structure for your web pages, allowing you to define a common header and footer while specifying unique content for each page. This is perfect for scenarios where you need a consistent header and footer but dynamic middle sections.

Which component in the MVC pattern is primarily responsible for handling user input?

  • Model
  • View
  • Controller
  • Middleware
In the MVC (Model-View-Controller) pattern, the Controller component is primarily responsible for handling user input. It receives HTTP requests, processes them, interacts with the Model (data), and determines which View (UI) to render as a response. It acts as the intermediary between the user's actions and the application's logic.