Apply attribute to page model rather than handler
This commit is contained in:
parent
c2089f9902
commit
6cdd622f23
|
|
@ -9,13 +9,13 @@ using Microsoft.AspNetCore.Mvc.RazorPages;
|
|||
namespace Microsoft.AspNetCore.Identity.UI.Pages
|
||||
{
|
||||
[AllowAnonymous]
|
||||
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
|
||||
public class ErrorModel : PageModel
|
||||
{
|
||||
public string RequestId { get; set; }
|
||||
|
||||
public bool ShowRequestId => !string.IsNullOrEmpty(RequestId);
|
||||
|
||||
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
|
||||
public void OnGet()
|
||||
{
|
||||
RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier;
|
||||
|
|
|
|||
|
|
@ -7,13 +7,13 @@ using Microsoft.AspNetCore.Mvc.RazorPages;
|
|||
|
||||
namespace Identity.DefaultUI.WebSite.Pages
|
||||
{
|
||||
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
|
||||
public class ErrorModel : PageModel
|
||||
{
|
||||
public string RequestId { get; set; }
|
||||
|
||||
public bool ShowRequestId => !string.IsNullOrEmpty(RequestId);
|
||||
|
||||
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
|
||||
public void OnGet()
|
||||
{
|
||||
RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier;
|
||||
|
|
|
|||
Loading…
Reference in New Issue