@page "/students/details" @attribute [Authorize] @using Microsoft.EntityFrameworkCore @using Core.Entities @using Data @inject AppDbContext context @inject NavigationManager NavigationManager Student Details - TSA Chapter Organizer Details Student @if (student is null) { Loading... } else { First Name @student.FirstName Last Name @student.LastName Grade @student.Grade Email @student.Email Phone Number @student.PhoneNumber TSA Year @student.TsaYear State ID @student.StateId Regional ID @student.RegionalId National ID @student.NationalId Officer Role @student.OfficerRole
Edit Back to List
} @code { private Student? student; [SupplyParameterFromQuery] private int Id { get; set; } protected override async Task OnInitializedAsync() { student = await context.Students.FirstOrDefaultAsync(m => m.Id == Id); if (student is null) { NavigationManager.NavigateTo("notfound"); } } }