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
|
namespace Microsoft.AspNetCore.Identity.UI.Pages
|
||||||
{
|
{
|
||||||
[AllowAnonymous]
|
[AllowAnonymous]
|
||||||
|
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
|
||||||
public class ErrorModel : PageModel
|
public class ErrorModel : PageModel
|
||||||
{
|
{
|
||||||
public string RequestId { get; set; }
|
public string RequestId { get; set; }
|
||||||
|
|
||||||
public bool ShowRequestId => !string.IsNullOrEmpty(RequestId);
|
public bool ShowRequestId => !string.IsNullOrEmpty(RequestId);
|
||||||
|
|
||||||
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
|
|
||||||
public void OnGet()
|
public void OnGet()
|
||||||
{
|
{
|
||||||
RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier;
|
RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier;
|
||||||
|
|
|
||||||
|
|
@ -7,13 +7,13 @@ using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||||
|
|
||||||
namespace Identity.DefaultUI.WebSite.Pages
|
namespace Identity.DefaultUI.WebSite.Pages
|
||||||
{
|
{
|
||||||
|
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
|
||||||
public class ErrorModel : PageModel
|
public class ErrorModel : PageModel
|
||||||
{
|
{
|
||||||
public string RequestId { get; set; }
|
public string RequestId { get; set; }
|
||||||
|
|
||||||
public bool ShowRequestId => !string.IsNullOrEmpty(RequestId);
|
public bool ShowRequestId => !string.IsNullOrEmpty(RequestId);
|
||||||
|
|
||||||
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
|
|
||||||
public void OnGet()
|
public void OnGet()
|
||||||
{
|
{
|
||||||
RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier;
|
RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue