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