Пример #1
0
        /// <summary>
        /// List all applications
        /// </summary>
        /// <param name="service"></param>
        /// <param name="ct"></param>
        /// <returns></returns>
        public static async Task <IEnumerable <ApplicationInfoApiModel> > ListAllApplicationsAsync(
            this IRegistryServiceApi service, CancellationToken ct = default)
        {
            var registrations = new List <ApplicationInfoApiModel>();
            var result        = await service.ListApplicationsAsync(null, null, ct);

            registrations.AddRange(result.Items);
            while (result.ContinuationToken != null)
            {
                result = await service.ListApplicationsAsync(result.ContinuationToken, null, ct);

                registrations.AddRange(result.Items);
            }
            return(registrations);
        }
Пример #2
0
        /// <summary>
        /// Find applications
        /// </summary>
        /// <param name="service"></param>
        /// <param name="query"></param>
        /// <returns></returns>
        public static async Task <IEnumerable <ApplicationInfoApiModel> > QueryAllApplicationsAsync(
            this IRegistryServiceApi service, ApplicationRegistrationQueryApiModel query)
        {
            var registrations = new List <ApplicationInfoApiModel>();
            var result        = await service.QueryApplicationsAsync(query, null);

            registrations.AddRange(result.Items);
            while (result.ContinuationToken != null)
            {
                result = await service.ListApplicationsAsync(result.ContinuationToken, null);

                registrations.AddRange(result.Items);
            }
            return(registrations);
        }