This repository has been archived on 2023-04-02. You can view files and clone it, but cannot push or open issues or pull requests.
trainav/bahnplan.web/Pages/Cards.cshtml.cs
2020-06-12 18:19:28 +02:00

21 lines
553 B
C#

using System.Collections.Generic;
using System.Linq;
using bahnplan.web.database;
using bahnplan.web.database.Tables;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc.RazorPages;
namespace bahnplan.web.Pages {
public class CardsModel : PageModel {
public List<Card> Cards;
public void OnGet() {
if (HttpContext.Session.GetString("authorized") != "true") {
return;
}
using var db = new Database.DbConn();
Cards = db.Cards.Where(p => p.UserId == int.Parse(HttpContext.Session.GetString("uid"))).ToList();
}
}
}