Which folder in an ASP.NET Core project typically contains static files like images, CSS, and JavaScript?

  • Models
  • Controllers
  • Views
  • wwwroot
In an ASP.NET Core project, static files like images, CSS, and JavaScript are typically stored in the "wwwroot" folder. This folder serves as a root for serving static web assets to clients. Placing static files here ensures they can be accessed directly via a web browser, enhancing the performance of your web application.

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.

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.

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.

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'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.

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.

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.

How does the ASP.NET Core MVC determine which controller and action to route a request to?

  • Through URL Routing
  • By Checking File Names
  • By Request Header
  • Through a Random Process
ASP.NET Core MVC determines the controller and action to route a request to through URL routing. The routing system maps incoming URLs to controller actions based on predefined route patterns, allowing for a clean and user-friendly URL structure in your web application.

In a certain scenario, you want to display a list of items in multiple views without repeating the same HTML and C# code. What would be the best approach in Razor views?

  • Razor Sections
  • Razor Partials
  • Razor Components
  • Razor Views
Razor Partials are reusable components in Razor views. They allow you to define a piece of HTML and C# code once and then include it in multiple views. This approach ensures code reusability and reduces duplication.

You've been asked to modify the configurations that get loaded during the startup of your ASP.NET Core application. Which file should you primarily focus on?

  • Startup.cs
  • appsettings.json
  • Program.cs
  • HomeController.cs
In an ASP.NET Core application, the Startup.cs file is where you primarily configure the application's services, middleware pipeline, and other startup-related settings. This is where you can modify how the application behaves during startup.

After completing the development of a feature, you decide to run tests to ensure that your new code doesn't break existing functionality. What is this type of testing called?

  • Regression Testing
  • Performance Testing
  • Usability Testing
  • Smoke Testing
Running tests after developing a new feature to ensure that existing functionality remains unaffected is known as Regression Testing. It helps catch unintended side effects or bugs introduced by new code changes.