protected override async Task OnParametersSetAsync()
        {
            switch (Page)
            {
            case null:
            case "lights":
                if (Lights is null)
                {
                    Lights = await LightService.GetAllAsync();
                }
                break;

            case "heats":
                if (Heats is null)
                {
                    Heats = await HeatService.GetAllAsync();
                }
                break;

            case "courts":
                if (Courts is null)
                {
                    Courts = await CourtService.GetAllAsync();
                }
                break;

            case "rates":
                if (Rates is null)
                {
                    Rates = await RatesService.GetAllAsync();
                }
                break;

            default:
                throw new KeyNotFoundException("Dashboard nested page not found!");
            }
        }
Beispiel #2
0
 protected override async Task OnInitializedAsync() => _courts = await CourtService.GetAllAsync();