diff options
| author | transtrike <transtrike@gmail.com> | 2020-12-10 13:54:23 +0200 |
|---|---|---|
| committer | transtrike <transtrike@gmail.com> | 2020-12-10 13:54:23 +0200 |
| commit | ee80c6ff969b5b4cfc3d1292f15928fc8bd2d667 (patch) | |
| tree | 02d126568767f77f78127a347b142e5225fab4de /Web/Pages/Error.cshtml.cs | |
| parent | 7941f1ab479b72ee53e94aef54b8390d21d36f84 (diff) | |
| download | DevHive-ee80c6ff969b5b4cfc3d1292f15928fc8bd2d667.tar DevHive-ee80c6ff969b5b4cfc3d1292f15928fc8bd2d667.tar.gz DevHive-ee80c6ff969b5b4cfc3d1292f15928fc8bd2d667.zip | |
Replaced ASP.NET Core MVC with Blazor
Diffstat (limited to 'Web/Pages/Error.cshtml.cs')
| -rw-r--r-- | Web/Pages/Error.cshtml.cs | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/Web/Pages/Error.cshtml.cs b/Web/Pages/Error.cshtml.cs new file mode 100644 index 0000000..404a034 --- /dev/null +++ b/Web/Pages/Error.cshtml.cs @@ -0,0 +1,32 @@ +using System;
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.Linq;
+using System.Threading.Tasks;
+using Microsoft.AspNetCore.Mvc;
+using Microsoft.AspNetCore.Mvc.RazorPages;
+using Microsoft.Extensions.Logging;
+
+namespace Web.Pages
+{
+ [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
+ [IgnoreAntiforgeryToken]
+ 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;
+ }
+ }
+}
|
