19. Which of the following is a built-in middleware in ASP.NET Core?

  • Map
  • UseSession
  • UseMvc
  • UseAuthentication

20. What is the purpose of dependency injection in software development?

  • Dependency injection is a technique for eliminating code duplication in an application.
  • Dependency injection is a way to achieve loose coupling between software components.
  • Dependency injection is a technique for optimizing performance and memory usage in an application.
  • Dependency injection is a design pattern used to enforce encapsulation in object-oriented programming.

21. Which of the following is NOT a built-in filter in ASP.NET Core?

  • AuthorizeFilter
  • ExceptionFilter
  • CustomFilter
  • ResultFilter

22. What is the purpose of the [HttpGet] attribute in ASP.NET Core?

  • To specify that a controller action should only be accessible via the GET HTTP method.
  • To specify that a controller action should only be accessible via the POST HTTP method.
  • To specify that a controller action should only be accessible via the PUT HTTP method.
  • To specify that a controller action should only be accessible via the DELETE HTTP method.

23. What is the purpose of dependency injection (DI) in ASP.NET Core?

  • To enable server-side sessions.
  • To add MVC to the request pipeline.
  • To facilitate loose coupling and improve testability of code.
  • To enable authentication and authorization.

24. Which of the following is a common way to handle exceptions in ASP.NET Core?

  • Using try-catch blocks in the application code.
  • Using the built-in middleware for exceptions handling.
  • Using custom filters for exceptions handling.
  • Using a third-party logging library to handle exceptions.

25. Which of the following is an advantage of using structured logging over traditional logging?

  • Structured logging is faster than traditional logging.
  • Structured logging is easier to read and analyze than traditional logging.
  • Structured logging takes up less disk space than traditional logging.
  • Structured logging is more customizable than traditional logging.

26. Which of the following is a recommended approach for logging sensitive data in an ASP.NET Core application?

  • Log the data as plaintext in the log files.
  • Use encryption to protect the data before logging it.
  • Use a third-party logging library to handle sensitive data.
  • Do not log sensitive data at all.

27. Which of the following is an advantage of using a centralized logging system?

  • It is more difficult to analyze logs from multiple sources.
  • It allows for more granular control over log data.
  • It provides a single location to search for log data from multiple sources.
  • It is more cost-effective than using multiple logging systems.

28. Which of the following is a common approach to handling logging in an ASP.NET Core application?

  • Using the built-in middleware for logging.
  • Using a third-party logging library.
  • Implementing custom filters for logging.
  • Logging directly in the application code.

Leave a Reply