Esempio n. 1
0
        public ActionResult Create()
        {
            var articleTypes   = _ArticleTypeService.Read();
            var selectListItem = new List <SelectListItem>(
                articleTypes.Select(
                    e => new SelectListItem {
                Text  = e.Name,
                Value = e.Id.ToString()
            }
                    )
                );

            ViewBag.ArticleTypes = new SelectList(selectListItem, "Value", "Text");

            return(View());
        }