public ActionResult Index() { var model = new LoginSubmitViewModel(); model.CommandActions.Add("Login", "Submit"); model.CommandActions.Add("Cancel", "Index"); return View(model); }
public ActionResult Submit(LoginSubmitViewModel viewModel) { if (ModelState.IsValid) { var command = new LoginSubmit { Password = viewModel.Password, UserName = viewModel.UserName }; var response = ProcessCommand<TypedMessageResponse<string>>(command); return Content(response.Data); } return Content("TODO: handle errors properly here."); }