예제 #1
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        public JsonResult CurrentUser()
        {
            User currentUser = Session[USER_SESSION_KEY] as User;

            if (currentUser != null)
            {
                return(new JsonResult()
                {
                    JsonRequestBehavior = JsonRequestBehavior.AllowGet,
                    Data = Mapper.Map <User, UserResponse>(currentUser)
                });
            }

            return(new JsonResult()
            {
                JsonRequestBehavior = JsonRequestBehavior.AllowGet,
                Data = UserResponse.Empty()
            });
        }