obsidian-web/Pages/Error.cshtml.cs
Curle b8da68566f Add a standard ASP.NET Core 2.2 WebApp.
All the files here were made by running the command
dotnet new webApp -o obsidian --no-https

HTTPS will be enforced net<->user by IIS, not by the web app itself.
2019-07-22 00:28:50 +01:00

24 lines
613 B
C#

using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
namespace obsidian.Pages
{
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
public class ErrorModel : PageModel
{
public string RequestId { get; set; }
public bool ShowRequestId => !string.IsNullOrEmpty(RequestId);
public void OnGet()
{
RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier;
}
}
}