//public static DBContext.EFUser ToEFUser(this Model.ApplicationUser user) //{ // Feedback.Data.EF.DBContext.EFUser efUser = new DBContext.EFUser() // { // }; // return efUser; //} public static Feedback.Core.Models.ApplicationUser ToAppUser(this Feedback.Data.EF.DBContext.EFUser user) { Model.ApplicationUser appUser = new Model.ApplicationUser() { Id = user.Id, UserName = user.UserName }; return(appUser); }
//public static DBContext.EFUser ToEFUser(this Model.ApplicationUser user) //{ // Feedback.Data.EF.DBContext.EFUser efUser = new DBContext.EFUser() // { // }; // return efUser; //} public static Feedback.Core.Models.ApplicationUser ToAppUser(this Feedback.Data.EF.DBContext.EFUser user) { Model.ApplicationUser appUser = new Model.ApplicationUser() { Id = user.Id, UserName = user.UserName }; return appUser; }
public ActionResult Register(RegisterViewModel model) { if (ModelState.IsValid) { var user = new ApplicationUser() { UserName = model.UserName }; var result = UserService.Create(user, model.Password); if (result.Succeeded) { SignIn(user, isPersistent: false); return RedirectToAction("Index", "Home"); } else { AddErrors(result); } } // If we got this far, something failed, redisplay form return View(model); }
private async Task SignInAsync(ApplicationUser user, bool isPersistent) { AuthenticationManager.SignOut(DefaultAuthenticationTypes.ExternalCookie); var identity = await UserService.CreateIdentityAsync(user, DefaultAuthenticationTypes.ApplicationCookie); AuthenticationManager.SignIn(new AuthenticationProperties() { IsPersistent = isPersistent }, identity); }
public ClaimsIdentity CreateIdentity(ApplicationUser user, string p) { var identity = userRepository.CreateIdentity(user, p); return identity; }
public Core.Utilities.FuncResult Create(ApplicationUser user, string p) { return userRepository.Create(user, p); }