using Demo.Core.Models;
using Demo.Data;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
using System.Collections.Generic;
using System.Linq;

namespace Demo.Web.Pages.Users
{
    public class UsersModel : PageModel
    {
        private IPtUserRepository _userRepository;

        public UsersModel(IPtUserRepository userRepository)
        {
            _userRepository = userRepository;
        }

        public List<PtUser> Users { get; set; }

        public void OnGet()
        {
            Users = _userRepository.GetAll().ToList();
        }
    }
}
