partial void HandleImplementation(CreateAccount message) { // Implement your handler logic here. Console.WriteLine("AccountManagement received " + message.GetType().Name); }
public ActionResult Register(RegisterModel model) { if (ModelState.IsValid) { // Attempt to register the user try { //WebSecurity.CreateUserAndAccount(model.UserName, model.Password); //WebSecurity.Login(model.UserName, model.Password); var createAccountMessage = new CreateAccount { AccountId = Guid.NewGuid(), Email = model.UserName }; MvcApplication.Bus.Send(createAccountMessage); return RedirectToAction("Index", "Home"); } catch (MembershipCreateUserException e) { ModelState.AddModelError("", ErrorCodeToString(e.StatusCode)); } } // If we got this far, something failed, redisplay form return View(model); }
public void Send(CreateAccount message) { Bus.Send(message); }