public async Task <ActionResult> Index()
        {
            var currentUserName = User.Identity.Name;
            var userJson        = _apiDataCacheService.GetApiData(currentUserName, ApiStorageConstants.APIDATA_KEY_USER);

            if (userJson == null)
            {
                // get the data from the API
                var client = CreateClient();
                var user   = await client.User.Current();

                _apiDataCacheService.StoreApiData(currentUserName, ApiStorageConstants.APIDATA_KEY_USER, user);

                return(Json(User, JsonRequestBehavior.AllowGet));
            }

            return(Content(userJson, "application/json", Encoding.UTF8));
        }
        public ActionResult Index()
        {
            var db        = Storage.CreateConnection();
            var dbRepos   = _githubApiDataCache.GetApiData <List <GithubApiRepository> >(User.Identity.Name, ApiStorageConstants.APIDATA_KEY_REPOSITORIES);
            var userRepos = dbRepos.Select(r => r.FullName).ToArray();


            // get the users repositories that are being tracked in the system, plus any public repositories
            var visibleRepos =
                (List <CodeLocation>)db.CodeLocations.FindAll(db.CodeLocations.FullName == userRepos || db.CodeLocations.IsPublic == true);

            return(Json(visibleRepos, JsonRequestBehavior.AllowGet));
        }