Beispiel #1
0
        protected override async Task ActionAsync()
        {
            await UserSecurity.CheckIsSuperAdministratorAsync(_userService, Input.UserId);

            IList <Demo.User.User> users = new List <Demo.User.User>();
            var applicationUser          = await _userService.GetAllAsync();

            foreach (var user in applicationUser)
            {
                users.Add(MapUser.Map(user));
            }

            Result.Data = users;
        }
        protected override async Task ActionAsync()
        {
            if (!string.IsNullOrEmpty(Input.UserId))
            {
                var user = await _userService.FindApplicationUserByIdAsync(Input.UserId);

                if (user != null)
                {
                    Result.Data = new GetUserInfoResult()
                    {
                        User = MapUser.Map(user)
                    };
                }
                else
                {
                    Result.ValidationResult.AddError("NOT_AUTHENTICATED");
                }
            }
            else
            {
                Result.ValidationResult.AddError("NOT_AUTHENTICATED");
            }
        }