-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
-
\ No newline at end of file
+
diff --git a/BlazorApp/BlazorApp/Pages/Inventory.razor.cs b/BlazorApp/BlazorApp/Pages/Inventory.razor.cs
index 6c32433..fc4f0f5 100644
--- a/BlazorApp/BlazorApp/Pages/Inventory.razor.cs
+++ b/BlazorApp/BlazorApp/Pages/Inventory.razor.cs
@@ -23,7 +23,6 @@ namespace BlazorApp.Pages
}
Items = await DataService.List(0, await DataService.Count());
-
StateHasChanged();
}
}
diff --git a/BlazorApp/BlazorApp/Pages/InventoryPage.razor.cs b/BlazorApp/BlazorApp/Pages/InventoryPage.razor.cs
new file mode 100644
index 0000000..8f80632
--- /dev/null
+++ b/BlazorApp/BlazorApp/Pages/InventoryPage.razor.cs
@@ -0,0 +1,32 @@
+using System;
+using BlazorApp.Components;
+using BlazorApp.Models;
+using BlazorApp.Services;
+using Microsoft.AspNetCore.Components;
+
+namespace BlazorApp.Pages
+{
+ public partial class InventoryPage
+ {
+ [Inject]
+ public IDataService DataService { get; set; }
+
+ public List
- Items { get; set; } = new List
- ();
+
+ protected override async Task OnAfterRenderAsync(bool firstRender)
+ {
+ base.OnAfterRenderAsync(firstRender);
+
+ if (!firstRender)
+ {
+ return;
+ }
+
+ Items = await DataService.List(0, await DataService.Count());
+ Recipes = await DataService.GetRecipes();
+
+ StateHasChanged();
+ }
+ }
+}
+