using System.Security.Claims; using Gremlin_BlazorServer.Data.EntityClasses; using Gremlin_BlazorServer.Services; using Microsoft.AspNetCore.Components; using Microsoft.AspNetCore.Components.Authorization; namespace Gremlin_BlazorServer.Pages.Quotes; public partial class QuoteCreate { private IList? foundProducts; private IList? lineItems; private string optionNumber = ""; private string productNumber = ""; private Product selectedProduct; [CascadingParameter] private Task? AuthenticationStateTask { get; set; } protected override async Task OnInitializedAsync() { if (AuthenticationStateTask != null) { ClaimsPrincipal user = (await AuthenticationStateTask).User; if (user.Identity is { IsAuthenticated: true }) { // quotes = await GenericController.GetAllAsync(); } } await base.OnInitializedAsync(); } private async Task OnSearchChanged() => foundProducts = await GenericController.GetAllAsync(p => p.ProductNumber.Contains(productNumber) && p.OptionNumber.Contains(optionNumber)); private void OnSelectedProductChanged(Product product) => selectedProduct = product; }