NuSurvey.Web.Controllers.QuestionController.Create C# (CSharp) Method

Create() public method

#2 GET: /Question/Create
public Create ( int id, int categoryId ) : System.Web.Mvc.ActionResult
id int Survey Id
categoryId int
return System.Web.Mvc.ActionResult
        public ActionResult Create(int id, int? categoryId)
        {
            var survey = Repository.OfType<Survey>().GetNullableById(id);
            if (survey == null)
            {
                Message = "Survey Not Found";
                return this.RedirectToAction<ErrorController>(a => a.Index());
            }
            var viewModel = QuestionViewModel.Create(Repository, survey);
            if (categoryId != null)
            {
                var category = Repository.OfType<Category>().GetNullableById(categoryId.Value);
                viewModel.Category = category;
            }

            return View(viewModel);
        }

Same methods

QuestionController::Create ( int id, int categoryId, Question question, ResponsesParameter response ) : System.Web.Mvc.ActionResult