+ Request ID: @RequestId
+
+ Swapping to Development environment will display more detailed information about the error that occurred. +
++ The Development environment shouldn't be enabled for deployed applications. + It can result in displaying sensitive information from exceptions to end users. + For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development + and restarting the app. +
+ +@code{ + [CascadingParameter] + private HttpContext? HttpContext { get; set; } + + private string? RequestId { get; set; } + private bool ShowRequestId => !string.IsNullOrEmpty(RequestId); + + protected override void OnInitialized() => + RequestId = Activity.Current?.Id ?? HttpContext?.TraceIdentifier; +} diff --git a/BlazorCanvas/BlazorCanvas/Pages/Index.razor b/BlazorCanvas/BlazorCanvas.Server/Components/Pages/Home.razor similarity index 80% rename from BlazorCanvas/BlazorCanvas/Pages/Index.razor rename to BlazorCanvas/BlazorCanvas.Server/Components/Pages/Home.razor index 74b820b..3662534 100644 --- a/BlazorCanvas/BlazorCanvas/Pages/Index.razor +++ b/BlazorCanvas/BlazorCanvas.Server/Components/Pages/Home.razor @@ -3,7 +3,7 @@ @using Blazor.Extensions.Canvas @using Blazor.Extensions.Canvas.Canvas2D @using Blazor.Extensions.Canvas.WebGL -@using BlazorCanvas.Data +@using BlazorCanvas.Server.Components.Data @using Newtonsoft.Json @using Newtonsoft.Json.Linq @inject CanvasService canvasService @@ -36,11 +36,21 @@ - +This component demonstrates showing data.
+ +@if (forecasts == null) +{ +Loading...
+} +else +{ +Date | +Temp. (C) | +Temp. (F) | +Summary | +
---|---|---|---|
@forecast.Date.ToShortDateString() | +@forecast.TemperatureC | +@forecast.TemperatureF | +@forecast.Summary | +
Sorry, there's nothing at this address.
-
- Request ID: @Model.RequestId
-
- Swapping to the Development environment displays detailed information about the error that occurred. -
-- The Development environment shouldn't be enabled for deployed applications. - It can result in displaying sensitive information from exceptions to end users. - For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development - and restarting the app. -
-This component demonstrates fetching data from a service.
- -@if (forecasts == null) -{ -Loading...
-} -else -{ -Date | -Temp. (C) | -Temp. (F) | -Summary | -
---|---|---|---|
@forecast.Date.ToShortDateString() | -@forecast.TemperatureC | -@forecast.TemperatureF | -@forecast.Summary | -