1
+ /* Yet Another Forum.NET
2
+ * Copyright (C) 2003-2005 Bjørnar Henden
3
+ * Copyright (C) 2006-2013 Jaben Cargman
4
+ * Copyright (C) 2014-2024 Ingo Herbote
5
+ * https://www.yetanotherforum.net/
6
+ *
7
+ * Licensed to the Apache Software Foundation (ASF) under one
8
+ * or more contributor license agreements. See the NOTICE file
9
+ * distributed with this work for additional information
10
+ * regarding copyright ownership. The ASF licenses this file
11
+ * to you under the Apache License, Version 2.0 (the
12
+ * "License"); you may not use this file except in compliance
13
+ * with the License. You may obtain a copy of the License at
14
+
15
+ * https://www.apache.org/licenses/LICENSE-2.0
16
+
17
+ * Unless required by applicable law or agreed to in writing,
18
+ * software distributed under the License is distributed on an
19
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
20
+ * KIND, either express or implied. See the License for the
21
+ * specific language governing permissions and limitations
22
+ * under the License.
23
+ */
24
+
25
+ #nullable enable
26
+ using Microsoft . AspNetCore . Mvc . RazorPages ;
27
+
28
+ using System . Diagnostics ;
29
+
30
+ using Microsoft . AspNetCore . Mvc ;
31
+
32
+ namespace YAF . SampleApp . Pages ;
33
+
34
+ [ ResponseCache ( Duration = 0 , Location = ResponseCacheLocation . None , NoStore = true ) ]
35
+ [ IgnoreAntiforgeryToken ]
36
+ public class ErrorModel : PageModel
37
+ {
38
+ public string ? RequestId { get ; set ; }
39
+
40
+ public bool ShowRequestId => ! string . IsNullOrEmpty ( RequestId ) ;
41
+
42
+ public ErrorModel ( ILogger < ErrorModel > logger )
43
+ {
44
+ }
45
+
46
+ public void OnGet ( )
47
+ {
48
+ RequestId = Activity . Current ? . Id ?? HttpContext . TraceIdentifier ;
49
+ }
50
+ }
0 commit comments