Ejemplo n.º 1
0
        public ActionResult Followers(int?id)
        {
            if (id == null)
            {
                //HttpError("404");
                return(new HttpNotFoundResult("User Not Found"));
            }

            var      responseFromServer = SoundCloudRestAPI.retriveUserFollowers((int)id);
            UserList users = _userRepository.createUsersFromJson(responseFromServer);

            return(PartialView(users));
        }
Ejemplo n.º 2
0
        //TODO WRAP AROUND TRY/CATCH
        public ActionResult Index()
        {
            //obtain cookie
            var authToken = CookieHandler.retriveValueFromCookie(Request, "SoundCloudToken");

            /* wrap this function */
            if (authToken == null)
            {
                return(RedirectToAction("Index", "Login"));
            }
            var responseFromServer = SoundCloudRestAPI.retriveMe(Request);

            User user = _userRepository.createUserFromJson(responseFromServer);

            return(View(user));
        }
Ejemplo n.º 3
0
        // GET: api/User/5

        //TODO WRAP AROUND TRY/CATCH
        public ActionResult Detail(int?id)
        {
            if (id == null)
            {
                //HttpError("404");
                return(new HttpNotFoundResult("User Not Found"));
            }

            /* wrap this function
             * if (authToken == null)
             * {
             *  return RedirectToAction("Index", "Login");
             * }
             */
            var responseFromServer = SoundCloudRestAPI.retriveUser((int)id);

            if (responseFromServer == null)
            {
                return(new HttpNotFoundResult("User Not Found"));
            }
            User user = _userRepository.createUserFromJson(responseFromServer);

            return(View(user));
        }