public CreateUserParams(CreatePersonViewModel user, bool isApproved) { _username = user.Username; _password = user.Password; _email = user.Email; _isApproved = isApproved; }
public ActionResult Init() { if (QueryBuilder.For<Person>().Query().Any()) { throw new HttpException(404, CoreStrings.Error404); } var model = new CreatePersonViewModel() {Email = "*****@*****.**", Password = "******", Username = "******"}; var user = membership.CreateUser(new CreateUserParams(model, true)); if (user == null) { ModelState.AddModelError("Authentication", CoreStrings.AuthenticationError); RedirectToAction("LogOn"); } AuthenticationService.SignIn(user, true); UnitOfWork.Save(user); UnitOfWork.Commit(); return RedirectToAction("LogOn"); }