public IActionResult Index()
        {
            var user = HttpContext.User as User ?? _userManager.GetUserByUserName(HttpContext.User.Identity?.Name);

            var result = _monitoringCore.GetSensorsTree(user);
            var tree   = new TreeViewModel(result);

            _treeManager.AddOrCreate(user, tree);

            return(View(tree));
        }
        public IActionResult Index()
        {
            var user = HttpContext.User as User ?? _userManager.GetUserByUserName(HttpContext.User.Identity?.Name);
            var tree = _treeManager.GetTreeViewModel(user);

            if (tree == null)
            {
                var result = _sensorsInterface.GetSensorsTree(user);
                tree = new TreeViewModel(result);
                _treeManager.AddOrCreate(user, tree);
            }

            return(View(tree));
        }