Пример #1
0
        //
        // GET: /Option/

        public ActionResult Index()
        {
            var Options = _optionRepository.FindAllOptions();

            Options.OrderBy(x => x.OptionCategory.Name);

            if (Request.IsAjaxRequest())
            {
                var jsonOption = from Option in Options
                                 select new JsonOption
                {
                    Name         = Option.Name,
                    Option_Id    = Option.Option_Id,
                    Type         = Option.DataType.Name,
                    CategoryName = Option.OptionCategory.Name
                };

                return(Json(jsonOption.ToList()));
            }

            return(View(Options));
        }