40 lines
990 B
C#
40 lines
990 B
C#
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<IActionResult> OnGetAsync(string? id)
|
|
{
|
|
Guid guid = Guid.Parse(id);
|
|
if (id == null)
|
|
{
|
|
return NotFound();
|
|
}
|
|
CurSession = Context.Sessions.Find(guid);
|
|
if (CurSession == null)
|
|
{
|
|
return NotFound();
|
|
}
|
|
return Page();
|
|
}
|
|
}
|
|
}
|