@using Groceries.Data @using Microsoft.EntityFrameworkCore @inject IDbContextFactory DbContextFactory
@ChildContent
@code { [Parameter] public Store? Store { get; set; } [Parameter] public RenderFragment? ChildContent { get; set; } [Parameter(CaptureUnmatchedValues = true)] public Dictionary? AdditionalAttributes { get; set; } private Retailer[] retailers = []; protected override async Task OnInitializedAsync() { using var dbContext = DbContextFactory.CreateDbContext(); retailers = await dbContext.Retailers .OrderBy(retailer => retailer.Name) .ToArrayAsync(); } }