Exemplo n.º 1
0
        public IHttpActionResult GetUserInfo(string userName)
        {
            AccountsRepository accRepo = new AccountsRepository();
            ApplicationUser    user    = accRepo.GetAuthenticatedUserInfo(userName);

            if (user != null)
            {
                return(Ok(new User()
                {
                    Id = user.Id,
                    UserName = user.UserName,
                    Password = "",
                    EmailID = user.EmailID,
                    RoleId = user.UserRoleId,
                    FirstName = string.Empty,
                    LastName = string.Empty
                }));
            }

            else
            {
                return(Ok(false));
            }
        }