MCPcopy Create free account
hub / github.com/bbachi/react-dotnet-example / ErrorModel

Class ErrorModel

Pages/Error.cshtml.cs:12–30  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected