public ActionResult CreateAccount(CreateAccountViewModel vm) { using (var client = new UserProfileServiceReference.UserProfileServiceClient()) { var newUser = new UserProfileServiceReference.NewUser() { Email = vm.email, FirstName = vm.firstname, Surname = vm.surname, Password = vm.password, Username = vm.username, }; var user = client.CreateUser(newUser); if (user != null) { Session["AuthorizedAsUser"] = "******"; Session["UserId"] = client.GetUserByUserName(vm.username).Id; } } if (Session["AuthorizedAsUser"] == "true") { return(View("UpdateProfile")); } else { return(View("Index")); } }
// GET: UserProfile public ActionResult Index() { using (var client = new UserProfileServiceReference.UserProfileServiceClient()) { var User = client.GetUserByUserName("Clark"); } return(View()); }