| using System.Diagnostics; |
| using Microsoft.AspNetCore.Mvc; |
| using Microsoft.AspNetCore.Mvc.RazorPages; |
| using Microsoft.Extensions.Logging; |
| |
| namespace BaSyx.Common.UI.Pages |
| { |
| [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)] |
| public class ErrorPageModel : PageModel |
| { |
| public string RequestId { get; set; } |
| |
| public bool ShowRequestId => !string.IsNullOrEmpty(RequestId); |
| |
| private readonly ILogger<ErrorPageModel> _logger; |
| |
| public ErrorPageModel(ILogger<ErrorPageModel> logger) |
| { |
| _logger = logger; |
| } |
| |
| public void OnGet() |
| { |
| RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier; |
| } |
| } |
| } |