Esempio n. 1
0
        public HttpResponseMessage Get()
        {
            // Gets the username from the token provided on successful authentication.
            var username = _currentUser.GetUsernameFromToken();

            // Gets the correct user from the database
            var user = _bll.GetUser(username);

            return(Request.CreateResponse(user));
        }
Esempio n. 2
0
        /// <summary>
        /// Returns the view with the form for editing a user.
        /// </summary>
        /// <returns>
        /// View with the user found in the database.
        /// </returns>
        /// <param name="id">Database id of the user to be updated from the admin page.</param>
        public ActionResult EditUser(int id)
        {
            var user = _db.GetUser(id);

            return(View(user));
        }