public IActionResult EmployeeDetail(string id)
        {
            var employee = UsersDataService.GetById(id);

            if (employee == null)
            {
                return(NotFound());
            }


            return(View(new UsersViewModel
            {
                Id = employee.Id,
                FirstName = employee.FirstName,
                LastName = employee.LastName,
                Email = employee.Email,
                Age = employee.Age,
            }));
        }
        public IActionResult Index()
        {
            var user = userDataService.GetById(User.FindFirstValue(ClaimTypes.NameIdentifier));

            return(View(new UsersViewModel
            {
                FirstName = user.FirstName,
                LastName = user.LastName,
                Email = user.Email,
                Age = user.Age,
                Id = user.Id,
            }));
        }
示例#3
0
 public async Task <Users> GetByIdAsync(int userId)
 {
     return(await _usersDataService.GetById(userId));
 }
示例#4
0
        public async Task <UserDto> GetByIdAsync(int userId)
        {
            var entity = await _userService.GetById(userId);

            return(FactoryMapper.MapToDtoWithPassword(entity));
        }