auto.bus_razor/TicketOffice/Pages/Management/Users/Index.cshtml.cs

31 lines
771 B
C#

#nullable disable
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 TicketOffice.Data;
using TicketOffice.Models;
namespace TicketOffice.Pages.Management.Users
{
public class IndexModel : PageModel
{
private readonly TicketOffice.Data.TicketOfficeContext _context;
public IndexModel(TicketOffice.Data.TicketOfficeContext context)
{
_context = context;
}
public IList<User> User { get;set; }
public async Task OnGetAsync()
{
User = await _context.User.ToListAsync();
}
}
}