

using BlazorAppClean.Components;
using BlazorAppClean.Models;
using BlazorAppClean.Services;
using Microsoft.AspNetCore.Components;

namespace BlazorAppClean.Pages
{
    public partial class Inventory
    {
        [Inject]
        public IDataService DataService { get; set; }

        public List<Item> Items { get; set; } = new List<Item>();

        protected override async Task OnAfterRenderAsync(bool firstRender)
        {
            base.OnAfterRenderAsync(firstRender);

            if (!firstRender)
            {
                return;
            }

            Items = await DataService.getAll();

            StateHasChanged();
        }
    }
}
