private MapIdentityViewModel GetMapIdentityViewModel(int id) { var model = new MapIdentityViewModel { User = _usersResource.Get(id), BlogUsers = GetBlogUsers() }; return model; }
public ActionResult Map(MapIdentityViewModel model) { try { if (!ModelState.IsValid) { model.BlogUsers = model.BlogUsers ?? GetBlogUsers(); return View(model); } var user = model.User; user.IdentityId = model.SelectedIdentityId; _usersResource.Update(user); return RedirectToAction("Index"); } catch (Exception ex) { _errorSignaler.SignalFromCurrentContext(ex); ViewBag.ErrorMessage = ex.Message; model.BlogUsers = model.BlogUsers ?? GetBlogUsers(); return View(model); } }