|
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 WebApplication2.Pages |
11 | | -{ |
12 | | - [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)] |
13 | | - [IgnoreAntiforgeryToken] |
14 | | - public class ErrorModel : PageModel |
15 | | - { |
16 | | - public string RequestId { get; set; } |
17 | | - |
18 | | - public bool ShowRequestId => !string.IsNullOrEmpty(RequestId); |
19 | | - |
20 | | - private readonly ILogger<ErrorModel> _logger; |
21 | | - |
22 | | - public ErrorModel(ILogger<ErrorModel> logger) |
23 | | - { |
24 | | - _logger = logger; |
25 | | - } |
26 | | - |
27 | | - public void OnGet() |
28 | | - { |
29 | | - RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier; |
30 | | - } |
31 | | - } |
32 | | -} |
| 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 WebApplication2.Pages |
| 11 | +{ |
| 12 | + [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)] |
| 13 | + [IgnoreAntiforgeryToken] |
| 14 | + public class ErrorModel : PageModel |
| 15 | + { |
| 16 | + public string? RequestId { get; set; } |
| 17 | + |
| 18 | + public bool ShowRequestId => !string.IsNullOrEmpty(RequestId); |
| 19 | + |
| 20 | + private readonly ILogger<ErrorModel> _logger; |
| 21 | + |
| 22 | + public ErrorModel(ILogger<ErrorModel> logger) |
| 23 | + { |
| 24 | + _logger = logger; |
| 25 | + } |
| 26 | + |
| 27 | + public void OnGet() |
| 28 | + { |
| 29 | + RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier; |
| 30 | + } |
| 31 | + } |
| 32 | +} |
0 commit comments