In ASP.NET Core Identity, to create a user with specific claims, one can use the 'AddClaimsAsync' method after the user has been created using _________ method.

  • 'CreateAsync'
  • 'AddUserAsync'
  • 'RegisterAsync'
  • 'InitializeAsync'
In ASP.NET Core Identity, you create a user with the 'CreateAsync' method. Afterward, you can use the 'AddClaimsAsync' method to associate claims with the user. Claims are often used to store user-specific information or permissions.

What does the DbSet property in a DbContext represent?

  • A collection of entity objects for a specific entity type
  • A connection string to the database
  • A stored procedure
  • A view in the database
The DbSet property in a DbContext represents a collection of entity objects for a specific entity type. It acts as a DbSet that allows you to query, insert, update, and delete records of that entity type in the corresponding database table. It provides a convenient way to work with entities as if they were in-memory objects while abstracting the underlying database operations.

The ________ folder in an ASP.NET Core project is specifically designated for storing the compiled output of the application.

  • bin
  • obj
  • artifacts
  • publish
In an ASP.NET Core project, the "bin" folder is specifically designated for storing the compiled output of the application. This folder contains the executable files, libraries, and other artifacts generated during the build process. It's essential for running and deploying the application successfully.

The dotnet __________ command allows developers to run source code without previously compiling it.

  • build
  • compile
  • publish
  • run
The 'dotnet run' command is used to run .NET applications. It compiles and runs the source code in a single step, making it convenient for developers during the development and debugging process. This command is particularly handy for quickly testing and executing code without the need to explicitly compile it before execution.

In ASP.NET Core, which class provides methods to generate URLs?

  • HttpContext
  • RouteData
  • UrlHelper
  • Request
In ASP.NET Core, the UrlHelper class provides methods to generate URLs. It allows you to create URLs for different routes and actions in your application. You can access the UrlHelper within your controller or Razor views to generate URLs that point to specific routes or actions.

You've been asked to create a new website for your company's marketing team. Which ASP.NET Core template would be a good starting point for a site with static pages?

  • Razor Pages
  • Empty
  • Web API
  • MVC
Razor Pages is a great starting point for creating websites with static pages. It's a lightweight framework in ASP.NET Core designed for creating web pages without the complexities of full MVC. Razor Pages allow you to build simple, static web pages efficiently.

Which feature in ASP.NET Core Identity helps to manage user roles and claims?

  • Role-Based Authorization
  • IdentityServer4
  • Token Authentication
  • Swagger UI
Role-Based Authorization is a key feature of ASP.NET Core Identity that allows you to manage user roles and claims. It enables fine-grained access control by associating users with specific roles and defining role-based policies for authorization.

You're working on a .NET project with a team and want to ensure everyone uses the same .NET SDK version. What file, when added to your project, can specify the SDK version developers should use?

  • .gitignore
  • README.md
  • global.json
  • package.json
To specify the SDK version for a .NET project, you should add a "global.json" file to the project's root directory. This JSON file allows you to define the desired SDK version, ensuring consistency among team members and across development environments.

What file extension is commonly associated with Razor views?

  • .html
  • .cshtml
  • .js
  • .css
Razor views in ASP.NET Core commonly use the file extension ".cshtml." This extension indicates that the file contains both HTML markup and C# or VB.NET code, which can be executed on the server to generate dynamic web content.

To execute raw SQL queries in Entity Framework Core, developers can utilize the _________ method.

  • FromSqlRaw
  • ExecuteSql
  • ExecuteRawSql
  • ExecuteSqlCommand
Developers can utilize the "FromSqlRaw" method in Entity Framework Core to execute raw SQL queries. This method allows you to execute SQL queries directly and map the results to entity types. It's particularly useful when you need to work with complex queries or call stored procedures.