From 95db35940ce7a2e0583108186c37052de848e625 Mon Sep 17 00:00:00 2001 From: Louis GUICHARD-MONTGUERS Date: Sat, 8 Feb 2025 19:25:17 +0100 Subject: [PATCH] =?UTF-8?q?Mise=20=C3=A0=20jour=20de=20'WF-WebAdmin/WF-Web?= =?UTF-8?q?Admin/Pages/Error.cshtml.cs'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- WF-WebAdmin/WF-WebAdmin/Pages/Error.cshtml.cs | 80 +++++++++---------- 1 file changed, 40 insertions(+), 40 deletions(-) diff --git a/WF-WebAdmin/WF-WebAdmin/Pages/Error.cshtml.cs b/WF-WebAdmin/WF-WebAdmin/Pages/Error.cshtml.cs index 76bb3fe..a7a539c 100644 --- a/WF-WebAdmin/WF-WebAdmin/Pages/Error.cshtml.cs +++ b/WF-WebAdmin/WF-WebAdmin/Pages/Error.cshtml.cs @@ -1,40 +1,40 @@ -using Microsoft.AspNetCore.Mvc; -using Microsoft.AspNetCore.Mvc.RazorPages; -using System.Diagnostics; - -namespace WF_WebAdmin.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 _logger; - - - /// - /// Initializes a new instance of the class. - /// This constructor is used to inject the into the model for logging purposes. - /// - /// An instance of the used for logging error-related information. - public ErrorModel(ILogger logger) - { - _logger = logger; - } - - - /// - /// Handles the GET request for the page or endpoint. - /// This method retrieves the request ID for tracing purposes, using the `Activity.Current?.Id` - /// if it's available, or the `HttpContext.TraceIdentifier` as a fallback if no current activity ID is present. - /// - public void OnGet() - { - // Retrieve the current request ID for tracing - RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier; - } - } -} +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Mvc.RazorPages; +using System.Diagnostics; + +namespace WF_WebAdmin.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); + + + + + /// + /// Initializes a new instance of the class. + /// This constructor is used to inject the into the model for logging purposes. + /// + /// An instance of the used for logging error-related information. + public ErrorModel(ILogger logger) + { + _logger = logger; + } + + + /// + /// Handles the GET request for the page or endpoint. + /// This method retrieves the request ID for tracing purposes, using the `Activity.Current?.Id` + /// if it's available, or the `HttpContext.TraceIdentifier` as a fallback if no current activity ID is present. + /// + public void OnGet() + { + // Retrieve the current request ID for tracing + RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier; + } + } +}