using _2021_backend.Data; using _2021_backend.Models; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.RazorPages; using Microsoft.EntityFrameworkCore; using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; namespace _2021_backend.Pages.Sessions { public class DetailsModel : PageModel { public _2021_backend.Data.BackendContext Context; public DetailsModel(_2021_backend.Data.BackendContext context) { Context = context; } public Session CurSession { get; set; } public async Task OnGetAsync(string? id) { int idx = int.Parse(id); if (id == null) { return NotFound(); } CurSession = Context.Sessions.Find(idx); if (CurSession == null) { return NotFound(); } return Page(); } } }