Esempio n. 1
0
        public static async Task <int> Main(string[] args)
        {
            if (string.IsNullOrEmpty(s_connectionString) && args.Length > 0)
            {
                s_connectionString = args[0];
            }

            using RegistryManager registryManager = RegistryManager.CreateFromConnectionString(s_connectionString);

            var sample = new RegistryManagerSample(registryManager);

            await sample.RunSampleAsync().ConfigureAwait(false);

            Console.WriteLine("Done.");
            return(0);
        }
Esempio n. 2
0
        public static int Main(string[] args)
        {
            if (string.IsNullOrEmpty(s_connectionString) && args.Length > 0)
            {
                s_connectionString = args[0];
            }

            RegistryManager registryManager = RegistryManager.CreateFromConnectionString("HostName=IoTHub-Bo");

            var sample = new RegistryManagerSample(registryManager);

            sample.RunSampleAsync().GetAwaiter().GetResult();

            Console.WriteLine("Done.\n");
            return(0);
        }
        public static async Task Main(string[] args)
        {
            // Parse application parameters
            Parameters parameters            = null;
            ParserResult <Parameters> result = Parser.Default.ParseArguments <Parameters>(args)
                                               .WithParsed(
                parsedParams =>
            {
                parameters = parsedParams;
            })
                                               .WithNotParsed(
                errors =>
            {
                Environment.Exit(1);
            });

            var sample = new RegistryManagerSample(parameters);
            await sample.RunSampleAsync();

            Console.WriteLine("The sample has completed.");
        }