You're deploying your ASP.NET Core application on Azure. To monitor the application's performance and health, which Azure service can you use?

  • Azure Monitor
  • Azure Functions
  • Azure Storage
  • Azure Machine Learning
Azure Monitor is the Azure service designed for monitoring and gaining insights into the performance, health, and usage of applications deployed on Azure, including ASP.NET Core applications. It provides comprehensive monitoring and diagnostic capabilities.

To create users in ASP.NET Core Identity, developers typically interact with the _________ class.

  • ApplicationUser
  • UserManager
  • UserFactory
  • IdentityUser
To create users in ASP.NET Core Identity, developers typically interact with the 'UserManager' class. The 'UserManager' provides methods for user management, including user creation, deletion, and more.

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.

A colleague has created a Razor form, but you notice that the form data is appended to the URL upon submission, potentially exposing sensitive data. What might be the cause and how would you remedy it?

  • The form is using a GET request method
  • The form is missing an anti-forgery token
  • The form is missing client-side validation
  • The form is using AJAX for submission
The cause of the issue is likely that the form is missing an anti-forgery token (CSRF token). Without this token, ASP.NET Core won't accept the POST request, and the form data is sent as part of the URL, which is not secure. To remedy this, you should include the @Html.AntiForgeryToken() in your form and add [ValidateAntiForgeryToken] attribute to the corresponding action method in the controller.

Unit tests ensure that individual _________ of the software work as intended.

  • Units
  • Modules
  • Components
  • Pieces
Unit tests are designed to verify that individual units or components of a software application, such as methods or functions, work as intended. These units are typically small, self-contained parts of the software.

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.