Exemplo n.º 1
0
        public async Task <TResult> GetAllAuthorizationsAsync <TResult>(
            Func <LoginInfo[], TResult> onFound,
            Func <string, TResult> onServiceNotAvailable,
            Func <TResult> onServiceNotSupported,
            Func <string, TResult> onFailure)
        {
            var total = new LoginInfo[] { };

            return(await client.GetAllUsersAsync(
                       tuples =>
            {
                total = total.Concat(tuples
                                     .Select(tuple =>
                                             new LoginInfo
                {
                    loginId = tuple.Item1,
                    userName = tuple.Item3,
                    isEmail = tuple.Item4,
                    otherMail = tuple.Item5,
                    forceChange = tuple.Item6,
                    accountEnabled = tuple.Item7,
                    displayName = tuple.Item2,
                    forceChangePassword = tuple.Item6
                }))
                        .ToArray();
            },
                       () => onFound(total),
                       (why) => onFailure(why)));
        }