You've been asked to add a feature to your ASP.NET Core web application that allows live chat functionality. Which ASP.NET Core technology would help facilitate this feature?

  • SignalR
  • Entity Framework Core
  • ASP.NET Web Forms
  • Blazor
SignalR is a real-time web framework in ASP.NET Core that enables features like live chat. It allows bi-directional communication between the server and connected clients, making it ideal for building interactive and real-time applications. The other options are not related to live chat functionality.

Imagine you're working on an e-commerce application using ASP.NET Core MVC. A user wants to view details of a product. Which component of the MVC pattern would be responsible for fetching the product details from the database?

  • Model
  • View
  • Controller
  • Middleware
In the MVC (Model-View-Controller) pattern, the Model component is responsible for managing the application's data and business logic. In this scenario, it would be responsible for fetching the product details from the database. The Model interacts with the database and provides data to the Controller, which then passes it to the View for rendering.

If a developer is looking to quickly scaffold a new ASP.NET Core controller, which CLI command would they most likely use?

  • dotnet new controller
  • dotnet build
  • dotnet publish
  • dotnet test
To quickly scaffold a new ASP.NET Core controller, a developer would use the dotnet new controller CLI command. This command generates the necessary files and code structure for a controller, making it a time-saving tool for building web APIs and MVC applications.

Your application needs to restrict access based on the originating country of the request. How would you leverage middleware to achieve this requirement?

  • Use GeoIP databases within a custom middleware
  • Implement authorization policies
  • Create a filter attribute for country-based access
  • Modify the routing system
To restrict access based on the originating country of a request, you would typically use a custom middleware that utilizes GeoIP databases. This middleware can inspect the incoming request's IP address, determine the country, and then make access decisions accordingly. Authorization policies are more suitable for handling user roles and permissions, not geographical restrictions.

In ASP.NET Core, the _______ tag helper can be used to generate anchor (link) elements that link to MVC actions.

  • a
  • link
  • action
  • route
In ASP.NET Core, the a tag helper is used to generate anchor (link) elements that link to MVC actions. It simplifies the creation of hyperlinks to various parts of your application, making it easier to navigate between views and actions.

Where in an ASP.NET Core project would you typically find database migration files?

  • Controllers
  • Data
  • Models
  • Services
In an ASP.NET Core project, you would typically find database migration files in the "Data" folder. Database migration files are used to manage changes to the database schema over time. They define how the database structure evolves with updates to the application, making it easier to keep the database schema in sync with the application's requirements.

Which of the following is NOT a default template option when creating a new ASP.NET Core project?

  • Web API, Razor Pages, Windows Forms, Angular
  • Empty, Web API, Web Application, Blazor
  • Class Library, Console Application, Unit Test Project, Worker Service
  • None of the above
When creating a new ASP.NET Core project, "Windows Forms" is not a default template option. ASP.NET Core primarily focuses on web-based and cloud-based applications, so options like Web API, Razor Pages, and Blazor are more common project types.

You've just installed Visual Studio for ASP.NET Core development. Which tool should you ensure is also installed to help with command-line tasks for your projects?

  • .NET CLI
  • Docker
  • Git
  • Node.js
To perform command-line tasks in ASP.NET Core projects, you should ensure that the .NET CLI (Command Line Interface) is installed. It provides a set of commands for building, running, testing, and publishing ASP.NET Core applications.

Which HTTP status code is commonly associated with a server error caused by an unhandled exception in a web application?

  • 404 - Not Found
  • 200 - OK
  • 500 - Internal Server Error
  • 401 - Unauthorized
A server error caused by an unhandled exception in a web application is commonly associated with the HTTP status code 500 - Internal Server Error. This code indicates that an unexpected error occurred on the server, and it's a general indicator of a problem on the server side.

The @ViewData object is a type of _________, allowing you to pass data from the controller to the view.

  • Dictionary
  • List
  • Class
  • Interface
The @ViewData object is a type of Dictionary in ASP.NET Core. It is used to pass data from the controller to the view. ViewData allows you to share data between different parts of your application, making it available for rendering in the view.