Example #1
0
        public TypeEdgeHost(IConfigurationRoot configuration)
        {
            _deviceId = configuration.GetValue <string>("DeviceId");
            _iotHubConnectionString = configuration.GetValue <string>("IotHubConnectionString");


            if (string.IsNullOrEmpty(_iotHubConnectionString))
            {
                throw new Exception("Missing \"IotHubConnectionString\" value in configuration");
            }

            if (string.IsNullOrEmpty(_deviceId))
            {
                throw new Exception("Missing \"DeviceId\"value in configuration");
            }

            _containerBuilder = new ContainerBuilder();
            _hub = new EdgeHub();

            Upstream = new Upstream <JsonMessage>(_hub);

            _inContainer = File.Exists(@"/.dockerenv");

            _externalModules = new ModuleCollection();
        }