Which design principle suggests that each component of MVC (Model, View, Controller) should have a distinct and separate responsibility?

  • Separation of Concerns (SoC)
  • Don't Repeat Yourself (DRY)
  • Model-View-ViewModel (MVVM)
  • Object-Relational Mapping (ORM)
The Separation of Concerns (SoC) is a fundamental design principle in ASP.NET Core MVC. It advocates for dividing the application into distinct and separate components, where the Model handles data, the View manages the presentation, and the Controller orchestrates the flow of data between them. This separation enhances maintainability, testability, and scalability.

What is the primary purpose of Razor Layout Views in ASP.NET Core?

  • Define the structure for multiple views
  • Handle HTTP requests
  • Create database tables
  • Design user interfaces
Razor Layout Views in ASP.NET Core are primarily used to define the common structure or layout that multiple Razor views within your application will share. This allows you to maintain a consistent look and feel across various parts of your web application. They help separate the presentation logic from the content-specific views.

You've just started with ASP.NET Core and want to set up a new MVC project. Which tool or environment would you typically use to create this project?

  • Visual Studio Code
  • Photoshop
  • Notepad
  • Microsoft Word
To create a new ASP.NET Core MVC project, you would typically use an integrated development environment (IDE) like 'Visual Studio Code.' Visual Studio Code provides excellent support for ASP.NET Core development, including project templates and extensions that streamline the development process.

The _________ file was a unique feature in the early versions of ASP.NET Core but was later replaced in .NET Core 2.0 and beyond.

  • appsettings.json
  • package.json
  • project.json
  • web.config
The project.json file was used in the early versions of ASP.NET Core (then known as ASP.NET 5), but it was replaced with the .csproj file format in .NET Core 2.0 and beyond. The project.json file defined project dependencies and configuration settings.

In ASP.NET Core, custom middlewares can be created using a delegate with the signature _______.

  • Func
  • Action
  • Func
  • MiddlewareDelegate
Custom middlewares in ASP.NET Core are created using a delegate with the signature Func. This delegate takes an HttpContext as input and returns a Task, allowing you to write custom logic to handle requests and responses in the pipeline.

If you want to specify multiple roles for an action or a controller using the [Authorize] attribute, how would you do it?

  • [Authorize(Roles = "Admin, Manager")]
  • [Authorize(Role = "Admin", Role = "Manager")]
  • [Authorize("Admin, Manager")]
  • [Authorize("Admin", "Manager")]
To specify multiple roles using the [Authorize] attribute, you can separate them with commas inside the Roles parameter, like this: [Authorize(Roles = "Admin, Manager")]. This allows access to the action or controller for users who belong to either the "Admin" role or the "Manager" role or both.

Which of the following would NOT typically be found in the project.json file?

  • Target Framework Monikers
  • NuGet Package Dependencies
  • Build Scripts
  • Compiler Options
The "Build Scripts" would NOT typically be found in the project.json file. Project.json primarily focused on project structure, dependencies, and target frameworks, whereas build scripts were typically defined in other build-related files or tools specific to the build system.

Your organization wants to implement a deployment pipeline where every code change goes through a series of automated tests and, if successful, gets deployed to production automatically. What kind of deployment strategy is your organization aiming for?

  • Continuous Deployment (CD)
  • Blue-Green Deployment
  • Canary Deployment
  • Feature Toggles
Continuous Deployment (CD) is a deployment strategy where code changes are automatically deployed to production after passing automated tests. It enables rapid and reliable software delivery, ensuring that new features and bug fixes are quickly available to users.

Which command is commonly used to create a new migration for ASP.NET Core Identity changes?

  • dotnet ef migrations add
  • dotnet new migration
  • dotnet ef create migration
  • dotnet add migration
The commonly used command to create a new migration for ASP.NET Core Identity changes is 'dotnet ef migrations add'. This command generates a new migration file containing the necessary SQL scripts to update the database schema based on changes in your Identity-related code.

In SignalR, what term is used to describe a group of connections that can be broadcast to?

  • Hub
  • Cluster
  • Node
  • Router
In SignalR, a "Hub" is used to describe a group of connections that can be broadcast to. Hubs provide a high-level API for organizing connections and managing communication between clients and the server in real-time applications.