Exemplo n.º 1
0
        public async Task SearchUser(string value)
        {
            if (value.IsNullOrEmptyExt())
            {
                return;
            }

            _cancelToken?.Cancel();
            _cancelToken = new CancellationTokenSource();

            ShowLoading();
            var user = await GraphClientService.GetUserByUpnEmail(value, _cancelToken.Token);

            HideLoading();
            if (user != null)
            {
                var members = Selectedmembers.ToHashSet();
                if (!members.Contains(value))
                {
                    members.Add(user.AvailableUn);
                    Selectedmembers = members;
                    Snackbar.Add($"Member {user.DisplayName} added");
                }
                else
                {
                    Snackbar.Add($"Member {user.DisplayName} already selected");
                }
                //todo update model.priv
            }
        }