diff options
| author | ivar <i@oiee.no> | 2025-10-19 23:41:23 +0200 |
|---|---|---|
| committer | ivar <i@oiee.no> | 2025-10-19 23:41:23 +0200 |
| commit | 3f4c0720e1e3421431e7baa20882a4a4512a7fab (patch) | |
| tree | 734ca81d7d0841d8863e3f523ebba14c282dc681 /src/Pages/Error.cshtml.cs | |
| download | fagprove-master.tar.xz fagprove-master.zip | |
Diffstat (limited to 'src/Pages/Error.cshtml.cs')
| -rw-r--r-- | src/Pages/Error.cshtml.cs | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/Pages/Error.cshtml.cs b/src/Pages/Error.cshtml.cs new file mode 100644 index 0000000..e25c362 --- /dev/null +++ b/src/Pages/Error.cshtml.cs @@ -0,0 +1,27 @@ +using System.Diagnostics; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Mvc.RazorPages; +using Microsoft.Extensions.Logging; + +namespace IOL.Fagprove.Pages +{ + [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)] + public class ErrorModel : PageModel + { + public string RequestId { get; set; } + + public bool ShowRequestId => !string.IsNullOrEmpty(RequestId); + + private readonly ILogger<ErrorModel> _logger; + + public ErrorModel(ILogger<ErrorModel> logger) + { + _logger = logger; + } + + public void OnGet() + { + RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier; + } + } +} |
