Ejemplo n.º 1
0
        public async Task <string> AskVersion(string appId, string cfgProfileId)
        {
            var versions = await _client.ListHostedConfigurationVersionsAsync(new ListHostedConfigurationVersionsRequest
            {
                ApplicationId          = appId,
                ConfigurationProfileId = cfgProfileId
            });

            Console.Write($"Version (available, {string.Join(";", versions.Items.Select(x => $"[{x.VersionNumber}]"))}): ");
            var promptedVersion = Console.ReadLine();
            var version         =
                versions.Items.FirstOrDefault(x => x.VersionNumber.ToString() == promptedVersion);

            if (version == null)
            {
                throw new Exception($"Can't find version [{promptedVersion}]");
            }

            return(version.VersionNumber.ToString());
        }