Continous Integration in der Praxis Gruppenarbeit
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
889 B

2 years ago
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Diagnostics;
  4. using System.Linq;
  5. using System.Threading.Tasks;
  6. using Microsoft.AspNetCore.Mvc;
  7. using Microsoft.AspNetCore.Mvc.RazorPages;
  8. using Microsoft.Extensions.Logging;
  9. namespace BlazorMiniGames.Server.Pages
  10. {
  11. [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
  12. [IgnoreAntiforgeryToken]
  13. public class ErrorModel : PageModel
  14. {
  15. public string RequestId { get; set; }
  16. public bool ShowRequestId => !string.IsNullOrEmpty(RequestId);
  17. private readonly ILogger<ErrorModel> _logger;
  18. public ErrorModel(ILogger<ErrorModel> logger)
  19. {
  20. _logger = logger;
  21. }
  22. public void OnGet()
  23. {
  24. RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier;
  25. }
  26. }
  27. }