@page "/Teacher/Dashboard" @inject Blazored.SessionStorage.ISessionStorageService sessionStorage @inject NavigationManager NavManager @inherits Admin.ListBase; @using System.ComponentModel.DataAnnotations @using Syncfusion.Blazor.Grids; @using Syncfusion.Blazor.Buttons; @using Syncfusion.Blazor.Spinner; @using Syncfusion.Blazor.Navigations; @using Syncfusion.Blazor.Popups; @using BlazorApp.Helper @using BWPMModels; @code { string userid = ""; private Lehrer _lehrer { get; set; } = new BWPMModels.Lehrer(); public List Lehrerdaten { get; set; } protected override async Task OnAfterRenderAsync(bool firstRender) { if (firstRender != true) { return; }; var authState = await authenticationStateTask; userid = authState.User.Claims.FirstOrDefault().Value; var user = authState.User; await sessionStorage.SetItemAsync("UserID", userid); Lehrerdaten = BlazorApp.Controller.LehrerController.GetByUserID(userid); _lehrer = Lehrerdaten.First(); await sessionStorage.SetItemAsync("LehrerID", _lehrer.ID.ToString()); } }