示例#1
0
 public MHubService(IWebHostEnvironment env, IConfiguration config, MQueue queue, MDevice device)
 {
     _queue     = queue;
     _device    = device;
     _env       = env;
     _conString = config.GetConnectionString("Hub");
 }
示例#2
0
        public MSensorService(IWebHostEnvironment env, MQueue queue, MDevice device)
        {
            _queue  = queue;
            _device = device;

            _device.Interval = 5;

            // USE MOCK CLASS FOR TESTING...

            if (env.IsDevelopment())
            {
                _device.Sensor = new MSensorDev();
            }
            else
            {
                _device.Sensor = new MSensor();
            }
        }