예제 #1
0
        private async Task <int> ListInResourceGroupAsync(CommandContext context, AggregatorInstances instances)
        {
            var found = await instances.ListInResourceGroupAsync(ResourceGroup);

            bool any = false;

            foreach (var name in found)
            {
                context.Logger.WriteOutput(
                    name,
                    (data) => $"Instance {name}");
                any = true;
            }
            if (!any)
            {
                context.Logger.WriteInfo("No aggregator instances found.");
            }
            return(0);
        }
        private async Task <int> ListInResourceGroupAsync(CommandContext context, AggregatorInstances instances, CancellationToken cancellationToken)
        {
            var found = await instances.ListInResourceGroupAsync(ResourceGroup, cancellationToken);

            bool any = false;

            foreach (var dataObject in found)
            {
                context.Logger.WriteOutput(dataObject);
                any = true;
            }

            if (!any)
            {
                context.Logger.WriteInfo("No aggregator instances found.");
            }

            return(0);
        }