protected static Guid CreateAccount(string email, string password) { var createAccount = new CreateAccount { Email = email, Password = password, }; Bus.Publish(createAccount); Bus.Commit(); return createAccount.StreamId; }
public ActionResult Create(CreateAccountViewModel model) { if (ModelState.IsValid) { if (AccountAlreadyExists(model.Email)) { ModelState.AddModelError(string.Empty, "An account with this Email already exists."); } else { var createAccount = new CreateAccount { Email = model.Email, Password = model.Password1, }; _bus.PublishWithLatency(createAccount); return RedirectToAction("Login"); } } return View(model); }