Agribusiness.Web.Controllers.SeminarApplicationController.SaveComments C# (CSharp) Method

SaveComments() private method

private SaveComments ( int id, string comments ) : JsonNetResult
id int
comments string
return JsonNetResult
        public JsonNetResult SaveComments(int id, string comments)
        {
            var application = _applicationRepository.GetNullableById(id);
            if (application == null) return new JsonNetResult(string.Format(Messages.NotFound, "application", id));

            try
            {
                application.DecisionReason = comments;
                _applicationRepository.EnsurePersistent(application);

                return new JsonNetResult(string.Format(Messages.Saved, "Decision Reason"));
            }
            catch (Exception ex)
            {
                return new JsonNetResult("There was an error saving the comments, please reload page and try again.");
            }
        }