Minor reorganization

This commit is contained in:
Tony Bark 2025-04-29 03:29:57 -04:00
parent 9d9f951e9d
commit eeb17a1d50
6 changed files with 65 additions and 4 deletions

View file

@ -0,0 +1,57 @@
@page "/craft"
@inject HttpClient Http
<PageTitle>Sims2Craft</PageTitle>
<h1>Craft</h1>
<p>This component demonstrates fetching data from the server.</p>
@if (forecasts == null)
{
<p><em>Loading...</em></p>
}
else
{
<table class="table">
<thead>
<tr>
<th>Date</th>
<th>Temp. (C)</th>
<th>Temp. (F)</th>
<th>Summary</th>
</tr>
</thead>
<tbody>
@foreach (var forecast in forecasts)
{
<tr>
<td>@forecast.Date.ToShortDateString()</td>
<td>@forecast.TemperatureC</td>
<td>@forecast.TemperatureF</td>
<td>@forecast.Summary</td>
</tr>
}
</tbody>
</table>
}
@code {
private WeatherForecast[]? forecasts;
protected override async Task OnInitializedAsync()
{
forecasts = await Http.GetFromJsonAsync<WeatherForecast[]>("sample-data/weather.json");
}
public class WeatherForecast
{
public DateOnly Date { get; set; }
public int TemperatureC { get; set; }
public string? Summary { get; set; }
public int TemperatureF => 32 + (int)(TemperatureC / 0.5556);
}
}

View file

@ -1,4 +1,4 @@
@using System.Net.Http
@using System.Net.Http
@using System.Net.Http.Json
@using Microsoft.AspNetCore.Components.Forms
@using Microsoft.AspNetCore.Components.Routing
@ -8,3 +8,4 @@
@using Microsoft.JSInterop
@using PersonaForge.Blazor
@using PersonaForge.Blazor.Layout
@using PersonaForge

View file

@ -1,2 +0,0 @@
global using System.Text.Json;
global using System.CommandLine;

View file

@ -7,6 +7,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PersonaForge.Console", "Per
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PersonaForge", "PersonaForge\PersonaForge.csproj", "{316741E2-8BE3-4FBF-A10D-F8FF2AD6979E}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PersonaForge.Blazor", "PersonaForge.Blazor\PersonaForge.Blazor.csproj", "{381CCDD1-BB1A-45F0-8501-77769AB4578F}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -24,5 +26,9 @@ Global
{316741E2-8BE3-4FBF-A10D-F8FF2AD6979E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{316741E2-8BE3-4FBF-A10D-F8FF2AD6979E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{316741E2-8BE3-4FBF-A10D-F8FF2AD6979E}.Release|Any CPU.Build.0 = Release|Any CPU
{381CCDD1-BB1A-45F0-8501-77769AB4578F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{381CCDD1-BB1A-45F0-8501-77769AB4578F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{381CCDD1-BB1A-45F0-8501-77769AB4578F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{381CCDD1-BB1A-45F0-8501-77769AB4578F}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
EndGlobal

View file

@ -1,2 +1 @@
global using System.Text.Json;
global using System.CommandLine;