Files
zpc-bulletin-board/ZpcBulletinBoard/Pages/Boards/Index.cshtml.cs
2024-02-27 07:27:47 +01:00

25 lines
645 B
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
using Microsoft.EntityFrameworkCore;
using Microsoft.AspNetCore.Authorization;
using ZpcBulletinBoard.Data;
using ZpcBulletinBoard.Models.Editor;
namespace ZpcBulletinBoard.Pages.Boards
{
[Authorize]
public class IndexModel(ApplicationDbContext context) : PageModel
{
public IList<BulletinBoard> Boards { get;set; }
public async Task OnGetAsync()
{
Boards = await context.BulletinBoards.ToListAsync();
}
}
}