In ASP.NET Core Identity, the _________ method is used to authenticate a user with provided credentials.

  • SignInAsync
  • AuthenticateUser
  • AuthorizeUser
  • CheckCredentials
In ASP.NET Core Identity, the SignInAsync method is used to authenticate a user with provided credentials. This method handles the process of validating the user's username and password against the stored user data in the Identity system. It creates a security token for the authenticated user, allowing them access to protected resources.

You're working on an ASP.NET Core project where the client needs real-time updates from the server without constantly polling the server. Which technology in ASP.NET Core would you leverage?

  • SignalR
  • gRPC
  • WebSockets
  • REST API
In this scenario, you would leverage SignalR, which is a real-time communication library for ASP.NET Core. SignalR allows for bi-directional communication between the client and server, making it ideal for scenarios where you need real-time updates without the overhead of constant polling.

In a CI/CD pipeline, what does the acronym CI stand for?

  • Continuous Integration
  • Continuous Inspection
  • Continuous Improvement
  • Container Isolation
CI stands for Continuous Integration. It's a development practice where code changes are automatically built, tested, and integrated into the shared codebase frequently. This helps detect and fix integration issues early in the development process.

Your application uses ASP.NET Core Identity for authentication. During the security audit, it was pointed out that the application should enforce password reset every 90 days. How can you enforce this in ASP.NET Core?

  • Configure password expiration in IdentityOptions
  • Create a custom middleware to force password reset
  • Implement a password reset policy in the login controller
  • Use a third-party identity management library
To enforce password reset every 90 days in ASP.NET Core Identity, you should configure the password expiration policy in the IdentityOptions during application startup. This policy can be set to require users to change their passwords after a specified number of days.

When configuring ASP.NET Core Identity, the _________ class is used to specify policies like password strength and lockout duration.

  • 'PolicySettings'
  • 'AuthorizationOptions'
  • 'IdentityOptions'
  • 'SecurityPolicies'
When configuring ASP.NET Core Identity, the 'IdentityOptions' class is used to specify various settings, including policies like password strength and lockout duration. This class allows fine-grained control over the behavior of Identity.

You're given the task to create a form in a Razor view that posts data to an MVC action named "Create" in the "Products" controller. Which built-in Tag Helper can help you generate the form's action attribute correctly?

  • asp-controller
  • asp-area
  • asp-route
  • asp-for
To generate the form's action attribute correctly, you can use the built-in Tag Helper "asp-controller" to specify the controller name, which in this case would be "Products." This helps ensure that the form posts data to the correct MVC action.

You're noticing that despite having global exception handling set up in your ASP.NET Core application, certain exceptions aren't being caught. What might be a plausible reason for this behavior and how can you ensure all exceptions are captured?

  • Some exceptions may occur before the middleware pipeline
  • Certain exceptions bypass the UseExceptionHandler middleware
  • Exception filters are causing conflicts
  • There is a bug in the .NET Core runtime
In ASP.NET Core, some exceptions, such as those occurring early in the middleware pipeline, may bypass the UseExceptionHandler middleware. These include exceptions during routing and model binding. To ensure all exceptions are captured, consider using other middleware or filters to catch exceptions at different stages of the request pipeline.

The _______ directive in _ViewImports.cshtml is used to include a namespace across multiple Razor views.

  • @using
  • @model
  • @section
  • @namespace
In ASP.NET Core Razor views, the @using directive is used to include a namespace that can be accessed across multiple views. This is useful for making classes, methods, or extensions from the namespace available in your views.

When creating custom Razor tag helpers, the method _________ is overridden to generate the desired output.

  • Process
  • Execute
  • Generate
  • Handle
When creating custom Razor tag helpers in ASP.NET Core, you override the "Execute" method to generate the desired HTML output. This method is called when the tag helper is encountered in a Razor view, allowing you to customize the generated content.

What command would you typically use to create a new ASP.NET Core web application using the .NET Core CLI?

  • dotnet new web
  • dotnet build
  • dotnet run
  • dotnet publish
The correct command to create a new ASP.NET Core web application using the .NET Core CLI is dotnet new web. This command sets up a basic web application template for you to start building upon.

The _________ tool in ASP.NET Core is particularly useful for tasks like building the application, running migrations, or scaffolding items.

  • .NET CLI
  • Entity Framework
  • MSBuild
  • Visual Studio
The .NET CLI (Command Line Interface) in ASP.NET Core is a powerful tool for various development tasks. It allows developers to build, test, run, and manage ASP.NET Core applications from the command line. Tasks such as building the application, running database migrations, or scaffolding code can be efficiently accomplished using the .NET CLI.

When dealing with complex forms in Razor, which approach allows for grouping related form fields into smaller, reusable views?

  • Partial Views
  • Layout Views
  • Model Binding
  • Tag Helpers
When dealing with complex forms in Razor, using Partial Views is a common approach. Partial Views allow you to create modular and reusable components for form fields. This helps in organizing and maintaining complex forms by breaking them down into smaller, manageable parts.