using Microsoft.AspNetCore.Components; using Server.Data; using Server.Model; namespace Server.Components.Pages { public partial class InvoiceListPage : ComponentBase { #region Private Properties private List? Invoices { get; set; } #endregion #region Override SetParametersAsync //// public override async Task SetParametersAsync(ParameterView parameters) { parameters.SetParameterProperties(this); Invoices = await InvoiceData.LoadAllAsync(); await base.SetParametersAsync(ParameterView.Empty); } #endregion #region Private Method DeleteInvoiceAsync /// /// Deletes an invoice asynchronously by its ID. /// /// The ID of the invoice to be deleted. /// A task representing the asynchronous delete operation. private async Task DeleteInvoiceAsync(string? invoiceInvoiceId) { if (string.IsNullOrWhiteSpace(invoiceInvoiceId)) return; await InvoiceData.DeleteAsync(invoiceInvoiceId); Invoices = await InvoiceData.LoadAllAsync(); } #endregion } }