using System; using System.Security.AccessControl; using BlazorT.Composants; using BlazorT.Models; using BlazorT.Services; using Microsoft.AspNetCore.Components; namespace BlazorT.Pages; public partial class Inventory { [Inject] public IInventoryDataService DataService { get; set; } public List Items { get; set; } = new List(); private List Recipes { get; set; } = new List(); public int NombreRecipes; [Inject] public IConfiguration Configuration { set; get; } /// /// Method that is invoked after the component has been rendered. /// /// Boolean indicating if this is the first time the component is being rendered. /// A Task representing the asynchronous operation. protected override async Task OnAfterRenderAsync(bool firstRender) { base.OnAfterRenderAsync(firstRender); if (!firstRender) { return; } Items = await DataService.List(0, await DataService.Count()); NombreRecipes = Configuration.GetValue("NombreRecipes"); Recipes = await DataService.GetRecipes(); StateHasChanged(); } }