public TEntity Create(TEntity item)
        {
            var result = _dbSet.Add(item);

            _context.SaveChanges();
            return(result.Entity);
        }
예제 #2
0
        public ActionResult Create([Bind(Include = "ID,word")] Search search)
        {
            if (ModelState.IsValid)
            {
                db.Searchs.Add(search);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(search));
        }