@page "/settings/maschine"; @using Microsoft.EntityFrameworkCore @using CocktailWeb.Data @using Microsoft.AspNetCore.Components.Sections @inject IDbContextFactory DataContextFactory; Maschineneinstellungen

Ausgießer

@foreach (Filler f in Fillers.Where(f => f.Type == Filler.FillerType.Pourer)) { @f.Pos - @f.Flasche?.Name }

Pumpen

@foreach (Filler f in Fillers.Where(f => f.Type == Filler.FillerType.Pump)) { @f.Pos - @f.Flasche?.Name }
@code { private DbDataContext? _DataContext; private List Fillers { get; set; } = new(); private List Flaschen { get; set; } = new(); protected override async Task OnInitializedAsync() { await ShowFillers(); } private async Task ShowFillers() { _DataContext ??= await DataContextFactory.CreateDbContextAsync(); if (_DataContext != null) { Fillers = await _DataContext.Fillers.Include(f => f.Flasche).OrderBy(f => f.Pos).ToListAsync(); Flaschen = await _DataContext.Flaschen.OrderBy(fl => fl.Name).ToListAsync(); } } }