diff --git a/blazor_lab/Pages/Inventory.razor b/blazor_lab/Components/Inventory.razor
similarity index 71%
rename from blazor_lab/Pages/Inventory.razor
rename to blazor_lab/Components/Inventory.razor
index 74772ef..61a947d 100644
--- a/blazor_lab/Pages/Inventory.razor
+++ b/blazor_lab/Components/Inventory.razor
@@ -1,6 +1,4 @@
-@page "/inventory"
-@using Minecraft.Crafting.Api.Models
-@using blazor_lab.Components
+@using blazor_lab.Components
diff --git a/blazor_lab/Components/Inventory.razor.cs b/blazor_lab/Components/Inventory.razor.cs
new file mode 100644
index 0000000..fa0bb33
--- /dev/null
+++ b/blazor_lab/Components/Inventory.razor.cs
@@ -0,0 +1,15 @@
+using blazor_lab.Models;
+using Microsoft.AspNetCore.Components;
+using Microsoft.Extensions.Localization;
+
+namespace blazor_lab.Components
+{
+ public partial class Inventory
+ {
+ [Inject]
+ public IStringLocalizer
Localizer { get; set; }
+
+ [Parameter]
+ public List- Items { get; set; } = new();
+ }
+}
diff --git a/blazor_lab/Pages/Inventory.razor.css b/blazor_lab/Components/Inventory.razor.css
similarity index 100%
rename from blazor_lab/Pages/Inventory.razor.css
rename to blazor_lab/Components/Inventory.razor.css
diff --git a/blazor_lab/Pages/Inventory.razor.cs b/blazor_lab/Pages/Inventory.razor.cs
deleted file mode 100644
index f84cfee..0000000
--- a/blazor_lab/Pages/Inventory.razor.cs
+++ /dev/null
@@ -1,24 +0,0 @@
-using blazor_lab.Services;
-using Microsoft.AspNetCore.Components;
-using Microsoft.Extensions.Localization;
-using Minecraft.Crafting.Api.Models;
-using System.Diagnostics;
-
-namespace blazor_lab.Pages
-{
- public partial class Inventory
- {
- private List Items = new();
-
- [Inject]
- public IStringLocalizer Localizer { get; set; }
-
- [Inject]
- private DataApiService DataApiService { get; set; }
-
- protected override async Task OnInitializedAsync()
- {
- Items = await DataApiService.All();
- }
- }
-}
diff --git a/blazor_lab/Pages/InventoryPage.razor b/blazor_lab/Pages/InventoryPage.razor
new file mode 100644
index 0000000..021f98d
--- /dev/null
+++ b/blazor_lab/Pages/InventoryPage.razor
@@ -0,0 +1,8 @@
+@page "/inventory"
+@using blazor_lab.Components
+
+@Localizer["inventory"]
+
+
@Localizer["inventory"]
+
+
\ No newline at end of file
diff --git a/blazor_lab/Pages/InventoryPage.razor.cs b/blazor_lab/Pages/InventoryPage.razor.cs
new file mode 100644
index 0000000..aa9f35f
--- /dev/null
+++ b/blazor_lab/Pages/InventoryPage.razor.cs
@@ -0,0 +1,33 @@
+using blazor_lab.Components;
+using blazor_lab.Services;
+using Microsoft.AspNetCore.Components;
+using Microsoft.Extensions.Localization;
+
+namespace blazor_lab.Pages
+{
+ public partial class InventoryPage
+ {
+ [Inject]
+ public IStringLocalizer Localizer { get; set; }
+
+ [Inject]
+ private IDataService DataService { get; set; }
+
+
+ private List Items = new();
+
+ protected override async Task OnAfterRenderAsync(bool firstRender)
+ {
+ base.OnAfterRenderAsync(firstRender);
+
+ if (!firstRender)
+ {
+ return;
+ }
+
+ Items = await DataService.List(0, await DataService.Count());
+
+ StateHasChanged();
+ }
+ }
+}
diff --git a/blazor_lab/Program.cs b/blazor_lab/Program.cs
index af4cca6..52dbb2f 100644
--- a/blazor_lab/Program.cs
+++ b/blazor_lab/Program.cs
@@ -43,7 +43,7 @@ builder.Services.Configure(options =>
options.SupportedUICultures = new List { new CultureInfo("en-US"), new CultureInfo("fr-FR") };
});
-builder.Services.AddScoped();
+builder.Services.AddScoped();
var app = builder.Build();
diff --git a/blazor_lab/Resources/Pages.Inventory.fr-FR.resx b/blazor_lab/Resources/Components.Inventory.fr-FR.resx
similarity index 100%
rename from blazor_lab/Resources/Pages.Inventory.fr-FR.resx
rename to blazor_lab/Resources/Components.Inventory.fr-FR.resx
diff --git a/blazor_lab/Resources/Pages.Inventory.resx b/blazor_lab/Resources/Components.Inventory.resx
similarity index 100%
rename from blazor_lab/Resources/Pages.Inventory.resx
rename to blazor_lab/Resources/Components.Inventory.resx
diff --git a/blazor_lab/Resources/Components.InventoryList.fr-FR.resx b/blazor_lab/Resources/Components.InventoryList.fr-FR.resx
index cccd282..9450ea6 100644
--- a/blazor_lab/Resources/Components.InventoryList.fr-FR.resx
+++ b/blazor_lab/Resources/Components.InventoryList.fr-FR.resx
@@ -130,9 +130,9 @@
Trier par
- Trier par nom (Asc.)
+ nom (Asc.)
- Trier par nom (Desc.)
+ nom (Desc.)
\ No newline at end of file
diff --git a/blazor_lab/Resources/Components.InventoryList.resx b/blazor_lab/Resources/Components.InventoryList.resx
index 515e221..0e078f8 100644
--- a/blazor_lab/Resources/Components.InventoryList.resx
+++ b/blazor_lab/Resources/Components.InventoryList.resx
@@ -127,10 +127,10 @@
Search
- Sort by name (Asc.)
+ name (Asc.)
- Sort by name (Desc.)
+ name (Desc.)
Sort
diff --git a/blazor_lab/Resources/Pages.InventoryPage.fr-FR.resx b/blazor_lab/Resources/Pages.InventoryPage.fr-FR.resx
new file mode 100644
index 0000000..dd8a16d
--- /dev/null
+++ b/blazor_lab/Resources/Pages.InventoryPage.fr-FR.resx
@@ -0,0 +1,123 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ Inventaire
+
+
\ No newline at end of file
diff --git a/blazor_lab/Resources/Pages.InventoryPage.resx b/blazor_lab/Resources/Pages.InventoryPage.resx
new file mode 100644
index 0000000..6bf64db
--- /dev/null
+++ b/blazor_lab/Resources/Pages.InventoryPage.resx
@@ -0,0 +1,123 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ Inventory
+
+
\ No newline at end of file
diff --git a/blazor_lab/Services/DataApiService.cs b/blazor_lab/Services/DataApiService.cs
index 2e5c4ab..8156ed9 100644
--- a/blazor_lab/Services/DataApiService.cs
+++ b/blazor_lab/Services/DataApiService.cs
@@ -31,11 +31,6 @@ namespace blazor_lab.Services
return await _http.GetFromJsonAsync($"{_apiBaseUrl}/count");
}
- public async Task> All()
- {
- return await _http.GetFromJsonAsync>($"{_apiBaseUrl}/all");
- }
-
public async Task> List(int currentPage, int pageSize)
{
return await _http.GetFromJsonAsync>($"{_apiBaseUrl}/?currentPage={currentPage}&pageSize={pageSize}");
diff --git a/blazor_lab/blazor_lab.csproj b/blazor_lab/blazor_lab.csproj
index 2e58a00..9e1a300 100644
--- a/blazor_lab/blazor_lab.csproj
+++ b/blazor_lab/blazor_lab.csproj
@@ -1,34 +1,37 @@
-
- net6.0
- enable
- enable
-
+
+ net6.0
+ enable
+ enable
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
-
-
-
+
+
+
-
-
-
+
+
+
-
-
- Designer
-
-
- Designer
-
-
+
+
+ Designer
+
+
+ Designer
+
+
+ Designer
+
+