Error.cshtml.cs 497 B

12345678910111213141516171819
  1. using Microsoft.AspNetCore.Mvc;
  2. using Microsoft.AspNetCore.Mvc.RazorPages;
  3. using System.Diagnostics;
  4. namespace Admin.Pages;
  5. [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
  6. [IgnoreAntiforgeryToken]
  7. public class ErrorModel : PageModel
  8. {
  9. public string? RequestId { get; set; }
  10. public bool ShowRequestId => !string.IsNullOrEmpty(RequestId);
  11. public void OnGet()
  12. {
  13. RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier;
  14. }
  15. }