Blog.Admin.Web.Controllers.EducationController.Index C# (CSharp) Method

Index() public method

public Index ( int userId ) : System.Web.Mvc.ActionResult
userId int
return System.Web.Mvc.ActionResult
        public ActionResult Index(int userId)
        {
            try
            {
                var user = _usersResource.Get(userId);
                if (user.Education == null) throw new Exception("Failed to get education list. Try refreshing the page.");

                ViewBag.EducationHeader = string.Format("{0} {1}'s Education", user.FirstName, user.LastName);
                ViewBag.Username = user.UserName;
                ViewBag.UserId = user.Id;

                return View(user.Education);
            }
            catch (Exception ex)
            {
                _errorSignaler.SignalFromCurrentContext(ex);
                ViewBag.ErrorMessage = ex.Message;
                return View();
            }
        }