using System;
using System.Threading.Tasks;
using DotVVM.Framework.ViewModel;
using DotVVM.Framework.Runtime.Filters;
using ElectroShop.Services;
using ElectroShop.Models;
using System.Collections.Generic;

namespace ElectroShop.ViewModels
{
    [Authorize(Roles = "Administrator")]
    public class UsersManagementViewModel : MasterPageViewModel
    {
        private readonly UserService userService;

        public UsersManagementViewModel(UserService studentservice_)
        {
            this.userService = studentservice_;
        }

        [Bind(Direction.ServerToClient)]
        public List<UserListModel> Users { get; set; }

        public override async Task PreRender()
        {

            Users = userService.GetUsers();
            base.PreRender();
        }

    }
}
