Last change
on this file was 30a465f, checked in by DimitarSlezenkovski <dslezenkovski@…>, 4 years ago |
Initial commit
|
-
Property mode
set to
100644
|
File size:
810 bytes
|
Rev | Line | |
---|
[30a465f] | 1 | using System;
|
---|
| 2 | using System.Collections.Generic;
|
---|
| 3 | using System.Diagnostics;
|
---|
| 4 | using System.Linq;
|
---|
| 5 | using System.Threading.Tasks;
|
---|
| 6 | using Microsoft.AspNetCore.Mvc;
|
---|
| 7 | using Microsoft.AspNetCore.Mvc.RazorPages;
|
---|
| 8 | using Microsoft.Extensions.Logging;
|
---|
| 9 |
|
---|
| 10 | namespace Farmatiko.Pages
|
---|
| 11 | {
|
---|
| 12 | [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
|
---|
| 13 | public class ErrorModel : PageModel
|
---|
| 14 | {
|
---|
| 15 | private readonly ILogger<ErrorModel> _logger;
|
---|
| 16 |
|
---|
| 17 | public ErrorModel(ILogger<ErrorModel> logger)
|
---|
| 18 | {
|
---|
| 19 | _logger = logger;
|
---|
| 20 | }
|
---|
| 21 |
|
---|
| 22 | public string RequestId { get; set; }
|
---|
| 23 |
|
---|
| 24 | public bool ShowRequestId => !string.IsNullOrEmpty(RequestId);
|
---|
| 25 |
|
---|
| 26 | public void OnGet()
|
---|
| 27 | {
|
---|
| 28 | RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier;
|
---|
| 29 | }
|
---|
| 30 | }
|
---|
| 31 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.