using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
using WorkFlowCheck.Common.DTO;
using WorkFlowCheck.Web.Services.Interfaces;

namespace WorkFlowCheck.Web.Pages.UserAndRole
{
    public class UserEditPageModel : PageModel
    {
        private readonly ILogger<IndexModel> _logger;
        private readonly IUserService _userService;

        [BindProperty]
        public UserDTO User { get; set; }

        public UserEditPageModel(ILogger<IndexModel> logger, IUserService userService)
        {
            _userService = userService;
            _logger = logger;
        }

        public async Task OnGet(int id)
        {
            User = await _userService.GetUser(id);
        }
    }
}
