tpBlazor
Nicolas FRANCO 3 years ago
parent dce44a89b6
commit 309745e2bb

@ -0,0 +1,15 @@
namespace BlazorTp1.Models
{
public class Items
{
public int Id { get; set; }
public string DisplayName { get; set; }
public string Name { get; set; }
public int StackSize { get; set; }
public int MaxDurability { get; set; }
public List<string> EnchantCategories { get; set; }
public List<string> RepairWith { get; set; }
public DateTime CreatedDate { get; set; }
public DateTime? UpdatedDate { get; set; }
}
}

@ -2,4 +2,10 @@
<h3>List</h3> <h3>List</h3>
@if (items != null)
{
foreach (var item in items)
{
<div>@item.Id</div>
}
}

@ -1,6 +1,21 @@
namespace BlazorTp1.Pages using Microsoft.AspNetCore.Components;
using BlazorTp1.Models;
namespace BlazorTp1.Pages
{ {
public partial class List public partial class List
{ {
private Items[] items;
[Inject]
public HttpClient Http { get; set; }
[Inject]
public NavigationManager NavigationManager { get; set; }
protected override async Task OnInitializedAsync()
{
items = await Http.GetFromJsonAsync<Items[]>($"{NavigationManager.BaseUri}fake-data.json");
}
} }
} }

@ -9,6 +9,8 @@ builder.Services.AddRazorPages();
builder.Services.AddServerSideBlazor(); builder.Services.AddServerSideBlazor();
builder.Services.AddSingleton<WeatherForecastService>(); builder.Services.AddSingleton<WeatherForecastService>();
builder.Services.AddHttpClient();
var app = builder.Build(); var app = builder.Build();
// Configure the HTTP request pipeline. // Configure the HTTP request pipeline.

@ -1,3 +1,232 @@
{ {
[
{
"id": 1,
"displayname": "Mazuda",
"name": "mazuda",
"stacksize": 48,
"maxdurability": 55,
"enchantcategories": [
"armor_chest",
"weapon"
],
"repairwith": [
"dark_oak_planks",
"crimson_planks"
],
"createddate": "2015-05-08",
"updateddate": null
},
{
"id": 2,
"displayname": "Codact",
"name": "codact",
"stacksize": 57,
"maxdurability": 34,
"enchantcategories": [
"breakable",
"armor_head"
],
"repairwith": [
"spruce_planks",
"warped_planks"
],
"createddate": "2022-06-23",
"updateddate": "2016-06-10"
},
{
"id": 3,
"displayname": "Delphide",
"name": "delphide",
"stacksize": 49,
"maxdurability": 94,
"enchantcategories": [
"digger"
],
"repairwith": [
"acacia_planks"
],
"createddate": "2015-01-19",
"updateddate": "2020-06-30"
},
{
"id": 4,
"displayname": "Obones",
"name": "obones",
"stacksize": 50,
"maxdurability": 5,
"enchantcategories": [
"breakable",
"armor",
"weapon"
],
"repairwith": [
"spruce_planks"
],
"createddate": "2017-12-17",
"updateddate": null
},
{
"id": 5,
"displayname": "Amril",
"name": "amril",
"stacksize": 32,
"maxdurability": 76,
"enchantcategories": [
"armor",
"weapon",
"digger"
],
"repairwith": [],
"createddate": "2015-10-18",
"updateddate": null
},
{
"id": 6,
"displayname": "Quiltigen",
"name": "quiltigen",
"stacksize": 64,
"maxdurability": 6,
"enchantcategories": [
"digger"
],
"repairwith": [],
"createddate": "2014-03-01",
"updateddate": null
},
{
"id": 7,
"displayname": "Optique",
"name": "optique",
"stacksize": 54,
"maxdurability": 112,
"enchantcategories": [
"armor_chest",
"armor",
"digger"
],
"repairwith": [],
"createddate": "2017-09-23",
"updateddate": "2017-04-16"
},
{
"id": 8,
"displayname": "Digigene",
"name": "digigene",
"stacksize": 1,
"maxdurability": 98,
"enchantcategories": [],
"repairwith": [],
"createddate": "2014-02-08",
"updateddate": null
},
{
"id": 9,
"displayname": "Exospeed",
"name": "exospeed",
"stacksize": 19,
"maxdurability": 16,
"enchantcategories": [
"armor_chest",
"armor",
"armor"
],
"repairwith": [
"warped_planks"
],
"createddate": "2017-01-27",
"updateddate": "2019-09-30"
},
{
"id": 10,
"displayname": "Zillidium",
"name": "zillidium",
"stacksize": 23,
"maxdurability": 37,
"enchantcategories": [],
"repairwith": [
"birch_planks",
"crimson_planks"
],
"createddate": "2016-07-15",
"updateddate": "2018-05-16"
},
{
"id": 11,
"displayname": "Menbrain",
"name": "menbrain",
"stacksize": 43,
"maxdurability": 52,
"enchantcategories": [
"vanishable"
],
"repairwith": [],
"createddate": "2014-11-29",
"updateddate": "2014-01-02"
},
{
"id": 12,
"displayname": "Accufarm",
"name": "accufarm",
"stacksize": 22,
"maxdurability": 88,
"enchantcategories": [
"armor_chest"
],
"repairwith": [
"spruce_planks",
"spruce_planks"
],
"createddate": "2018-11-02",
"updateddate": "2016-10-31"
},
{
"id": 13,
"displayname": "Interfind",
"name": "interfind",
"stacksize": 35,
"maxdurability": 51,
"enchantcategories": [],
"repairwith": [
"spruce_planks",
"warped_planks"
],
"createddate": "2020-01-16",
"updateddate": null
},
{
"id": 14,
"displayname": "Zolarity",
"name": "zolarity",
"stacksize": 29,
"maxdurability": 55,
"enchantcategories": [
"weapon",
"breakable",
"armor_head"
],
"repairwith": [
"spruce_planks"
],
"createddate": "2016-03-19",
"updateddate": "2018-10-10"
},
{
"id": 15,
"displayname": "Kangle",
"name": "kangle",
"stacksize": 20,
"maxdurability": 64,
"enchantcategories": [
"vanishable",
"armor_head",
"armor"
],
"repairwith": [
"dark_oak_planks"
],
"createddate": "2014-08-13",
"updateddate": null
}
]
} }

Loading…
Cancel
Save