Created
April 29, 2016 21:48
-
-
Save kdowswell/82ecde6bb31a8b9b7177b51bc05fa529 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ImportModelStateFromTempData] | |
public ActionResult Register() | |
{ | |
return View(); | |
} | |
[HttpPost, ValidateAntiForgeryToken, ValidateModelState] | |
public ActionResult Register(RegisterViewModel model) | |
{ | |
var command = _mapper.Map<RegisterCommand>(model); | |
try | |
{ | |
_mediator.Send(command); | |
} | |
catch (ValidationException e) | |
{ | |
ModelStateErrorFactory.AddErrors(ModelState, e.Errors); | |
} | |
return View(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment