Пример #1
0
        public ActionResult Create(SearchTerm searchterm)
        {
            if (ModelState.IsValid)
            {
                var searchTerm = new SearchTerm() { Term = searchterm.Term };
                _context.Save(searchTerm);

                return RedirectToAction("Index");
            }

            return View(searchterm);
        }
Пример #2
0
        public ActionResult Index()
        {
            var response = _client.Scan(new ScanRequest() {TableName = "SearchTerms"});

            var model = new List<SearchTerm>();

            foreach (var item in response.ScanResult.Items) {
                var searchTerm = new SearchTerm() {Term = item["Term"].S};
                model.Add(searchTerm);
            }

            return View(model);
        }