Error.cshtml.cs 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. // Licensed to the .NET Foundation under one or more agreements.
  2. // The .NET Foundation licenses this file to you under the MIT license.
  3. #nullable disable
  4. using System.Diagnostics;
  5. using Microsoft.AspNetCore.Authorization;
  6. using Microsoft.AspNetCore.Mvc;
  7. using Microsoft.AspNetCore.Mvc.RazorPages;
  8. namespace Admin.Areas.Identity.Pages;
  9. /// <summary>
  10. /// This API supports the ASP.NET Core Identity default UI infrastructure and is not intended to be used
  11. /// directly from your code. This API may change or be removed in future releases.
  12. /// </summary>
  13. [AllowAnonymous]
  14. [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
  15. public class ErrorModel : PageModel
  16. {
  17. /// <summary>
  18. /// This API supports the ASP.NET Core Identity default UI infrastructure and is not intended to be used
  19. /// directly from your code. This API may change or be removed in future releases.
  20. /// </summary>
  21. public string RequestId { get; set; }
  22. /// <summary>
  23. /// This API supports the ASP.NET Core Identity default UI infrastructure and is not intended to be used
  24. /// directly from your code. This API may change or be removed in future releases.
  25. /// </summary>
  26. public bool ShowRequestId => !string.IsNullOrEmpty(RequestId);
  27. /// <summary>
  28. /// This API supports the ASP.NET Core Identity default UI infrastructure and is not intended to be used
  29. /// directly from your code. This API may change or be removed in future releases.
  30. /// </summary>
  31. public void OnGet()
  32. {
  33. RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier;
  34. }
  35. }