Пример #1
0
        // GET: Identifier/Create
        public ActionResult Create()
        {
            List <SelectListItem> list = new List <SelectListItem>();
            var notices = _noticeContext.GetAll();

            foreach (var item in notices)
            {
                string notId = Convert.ToString(item.Id, CultureInfo.InvariantCulture);
                list.Add(new SelectListItem {
                    Text = item.Name, Value = notId
                });
            }

            ViewBag.ListOfNotices = list;
            return(View());
        }
Пример #2
0
        // GET: Notice
        public ActionResult Index()
        {
            var res = _noticeContext.GetAll();

            return(View(res));
        }